Opened 6 years ago

Closed 6 years ago

#10662 closed Bug (fixed)

Inconsistent ACF rule application between inline editor and standard editor

Reported by: Kevin Kamel Owned by: Piotrek Koszuliński
Priority: Normal Milestone: CKEditor 4.2.1
Component: General Version: 4.1
Keywords: Cc:

Description

This is a refinement of the ticket I filed in #10661. I am including a better example to show the problem.

See example, which links to remote assets on ckeditor. To use this file you can simply view it on your desktop.

The example loads 4 editor instance for standard toolbar, shared toolbar (inline) and floating toolbar (inline) and default toolbar (inline).

You will see that for this simple example the "marker" class from the style drop down does not display for any of the "inline" editors, however does show for the standard editor without a problem.

These are all default examples. The standard editor has ACF rules that allow class/id for spans, whereas the inline editor does not. This needs to be consistent.

Shouldn't the style drop down itself be loading ACF for style properly, as otherwise the style drop down cannot work??

There is no documentation for sample space or floating space - instead we can only read the examples that are for each plugin. The examples themselves have this same error. If you select "marker" and attempt to apply it to content it cannot work, and the class is stripped immediately.

See test for reasons.

Attachments (2)

sharedspace.html (2.1 KB) - added by Kevin Kamel 6 years ago.
example showing shared/floating/default inline editor stripping styles whereas standard editor does not
10662.html (1.2 KB) - added by Piotrek Koszuliński 6 years ago.

Download all attachments as: .zip

Change History (13)

Changed 6 years ago by Kevin Kamel

Attachment: sharedspace.html added

example showing shared/floating/default inline editor stripping styles whereas standard editor does not

comment:1 Changed 6 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.2.1
Status: newconfirmed
Version: 4.1

I confirm that editor with sharedspace plugin does remove span.marker. All other editors preserve those spans, although they are not visible due to styling issues in our samples (reported in other ticket, which I cannot find right now).

This seems to be a problem with loading order - toolbar for an editor using shared space is perhaps created too late.

comment:2 Changed 6 years ago by Piotrek Koszuliński

Simple, although not convenient workaround for now is to add all styles to ACF using config.extraAllowedContent.

comment:3 Changed 6 years ago by Kevin Kamel

Thanks for looking.

I am now using "config.extraAllowedContent" in the meantime to continue upgrading my application code, but I like the idea of ACF. Being able to control the content that is entered is so much better than dealing with the random garbage that people paste in from the internet.

comment:4 Changed 6 years ago by Piotrek Koszuliński

Owner: set to Piotrek Koszuliński
Status: confirmedassigned

comment:5 Changed 6 years ago by Piotrek Koszuliński

It turns out that sharedspace plugin creates toolbar (fires editor#uiSpace event) too early - on plugin#afterInit, instead of on editor#loaded, so editor#styleSet is not fired yet. It seems to be enough to do this on editor#loaded but with higher than creatores/themedui.js priority.

comment:6 Changed 6 years ago by Piotrek Koszuliński

Status: assignedreview

Pushed t/10662 on dev and tests.

Changed 6 years ago by Piotrek Koszuliński

Attachment: 10662.html added

comment:7 Changed 6 years ago by Piotrek Koszuliński

I attached sample for easier testing - in all editors text should be marked with yellow bg.

comment:8 Changed 6 years ago by Piotr Jasiun

Status: reviewreview_passed

I've added use strict to tests and passed review.

Samples still doesn't work, but this is because of this bug: #10150.

comment:9 Changed 6 years ago by Kevin Kamel

I think what pjasiun means is that the "sharedspace.html" doesn't highlight due to bug #10150 - but the example with an in document stylesheet as Reinmar posted in "10662.html" does work now.

Pretty sweet, thanks

comment:10 Changed 6 years ago by Piotr Jasiun

Exactly. 10662.html works fine, but because of #10150 sharedspace.html (but also inlineall.html, inlinebycode.html and other samples using inline) does not show marked text.

comment:11 Changed 6 years ago by Piotrek Koszuliński

Resolution: fixed
Status: review_passedclosed

Yes - #10150 is a separate issue and it is not even related to dev code, but more to our samples.

I fixed this issue on master with git:402f68f and tests with 2647673.

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