Ckeditor4: Justify plugin: Alignment buttons disappear from toolbar after disallowContent p{text-align} setup

Created on 12 Nov 2019  路  3Comments  路  Source: ckeditor/ckeditor4

Type of report

Bug

Provide detailed reproduction steps (if any)

  1. Initially, wanted to allow text alignment via justify plugin only for th td elements.
  2. By setting config.disallowedContent = 'p{text-align}';, alignment buttons disappear from toolbar. No problems with other elements e.g. config.disallowedContent = 'h2{text-align}';. CKE configuration:
config.allowedContent = {
      $1: {
        elements: CKEDITOR.dtd,
        attributes: true,
        styles: true,
        classes: true
      }
};
config.disallowedContent = 'p{text-align}';

Expected result

Not being able to set text alignment for configured elements via disallowedContent.

Actual result

Alignment buttons disappeared from toolbar altogether after specifying p{text-align} disallowedContent rule.

Other details

  • Browser: Chromium 78
  • OS: Ubuntu 18.04
  • CKEditor version: 4.13
  • Installed CKEditor plugins:
    'about' : 1,
    'basicstyles' : 1,
    'bidi' : 1,
    'blockquote' : 1,
    'clipboard' : 1,
    'contextmenu' : 1,
    'copyformatting' : 1,
    'devtools' : 1,
    'div' : 1,
    'elementspath' : 1,
    'enterkey' : 1,
    'entities' : 1,
    'floatingspace' : 1,
    'format' : 1,
    'horizontalrule' : 1,
    'htmlwriter' : 1,
    'iframe' : 1,
    'image' : 1,
    'indentblock' : 1,
    'indentlist' : 1,
    'justify' : 1,
    'link' : 1,
    'list' : 1,
    'liststyle' : 1,
    'magicline' : 1,
    'maximize' : 1,
    'nbsp' : 1,
    'pagebreak' : 1,
    'pastefromword' : 1,
    'pastetext' : 1,
    'pastetools' : 1,
    'preview' : 1,
    'print' : 1,
    'removeformat' : 1,
    'resize' : 1,
    'save' : 1,
    'selectall' : 1,
    'showblocks' : 1,
    'showborders' : 1,
    'sourcearea' : 1,
    'specialchar' : 1,
    'stylescombo' : 1,
    'tab' : 1,
    'table' : 1,
    'tabletools' : 1,
    'templates' : 1,
    'toolbar' : 1,
    'undo' : 1,
    'wysiwygarea' : 1
justify confirmed bug

All 3 comments

The issue exists due to the fact that justify uses enter mode tag and text-align attribute to verify if it can be enabled. Responsible code for the issue is here:
https://github.com/ckeditor/ckeditor4/blob/422c2342ee3e6ddc219ec24698aa9dd62a484a78/plugins/justify/plugin.js#L63

Any workarounds for this?

Any workarounds for this?

@frankfuu No.

Edit: Or, sorry, not that I know of.

Was this page helpful?
0 / 5 - 0 ratings