Opened 8 years ago
Last modified 7 years 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 )
Steps to reproduce
- Make sure the Justify plugin is available.
- Configure the editor to use the following custom ACF rules:
allowedContent: 'p ul{text-align};li'
- Load the editor. The Justify tool bar buttons are available, which is expected because we have the "p ul{text-align}" rule.
- 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
- 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 8 years ago by
Status: | new → confirmed |
---|
comment:2 Changed 7 years ago by
Owner: | set to Mateusz Samsel |
---|---|
Status: | confirmed → assigned |
comment:3 Changed 7 years ago by
Status: | assigned → review |
---|
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 7 years ago by
Description: | modified (diff) |
---|
comment:5 Changed 7 years ago by
Status: | review → review_failed |
---|
comment:6 Changed 7 years ago by
Status: | review_failed → review |
---|
comment:7 Changed 7 years ago by
Status: | review → review_failed |
---|
comment:8 Changed 7 years ago by
Status: | review_failed → review |
---|
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.