Opened 2 years ago

Last modified 23 months ago

#16808 review Bug

The Justify plugin doesn't obey the custom Advanced Content Filter rules

Reported by: Marius Dumitru Florea Owned by: Mateusz Samsel
Priority: Normal Milestone:
Component: General Version: 4.6.2
Keywords: justify acf Cc:

Description (last modified by Mateusz Samsel)

Steps to reproduce

  1. Make sure the Justify plugin is available.
  2. Configure the editor to use the following custom ACF rules:
allowedContent: 'p ul{text-align};li'
  1. Load the editor. The Justify tool bar buttons are available, which is expected because we have the "p ul{text-align}" rule.
  2. Verify that the custom ACF rules are active using the JavaScript console:
> CKEDITOR.instances.content.filter.check('ul{text-align}')
true
> CKEDITOR.instances.content.filter.check('li{text-align}')
false
  1. Create a list
  • first item
  • second item

Place the caret on the second item. The Justify buttons are still enabled. Click on the "Center" button from the tool bar.

Expected result

The Justify plugin should center the entire list (both items) because our custom ACF rules forbid the text-align style on the li element but allow it on the ul element.

Justify plugin should prevent of applying justification on disallow elements. If ACF forbid to apply text-align style on given element, then plugin should be disabled on such element.

Actual result

The Justify plugin centers the second list item, thus generating invalid content from the point of view of the ACF.

Other details (browser, OS, CKEditor version, installed plugins)

Any browser, Any OS, CKEditor 4.6.2, Justify plugin

Note that in my case I have to convert the generated HTML to a specific wiki syntax which doesn't support attributes/styles for the li element. So when the user saves the content the text-align style on the list item is lost. My users are thus complaining that the list alignment is lost. I don't want to disable the Justify plugin.

Change History (8)

comment:1 Changed 2 years ago by kkrzton

Status: newconfirmed

Confirmed with CKEditor 4.6.2 on Chrome. Also disallowedContent rule (http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-disallowedContent) does not have any effect.

comment:2 Changed 2 years ago by Mateusz Samsel

Owner: set to Mateusz Samsel
Status: confirmedassigned

comment:3 Changed 2 years ago by Mateusz Samsel

Status: assignedreview

PR https://github.com/ckeditor/ckeditor-dev/pull/372

Expected result qualifies for a new feature. It would change behaviour of justify plugin. Parent element cannot be aligned instead of selected child. Prepared solution will disable justify buttons, if selection will be made on disallow element.

comment:4 Changed 2 years ago by Mateusz Samsel

Description: modified (diff)

comment:6 Changed 23 months ago by Mateusz Samsel

Status: review_failedreview

comment:8 Changed 23 months ago by Mateusz Samsel

Status: review_failedreview
Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy