Open mabryl opened 6 months ago
@niegowski I assume this is expected after our changes (and is a โwon't fixโ on our side). We fixed the bug, and background
is consumed properly by the Font
plugin (and will be handled by this plugin in the UI), and custom-attribute
is handled by GHS. Therefore, the engine correctly outputs two span
's.
@niegowski I assume this is expected after our changes (and is a โwon't fixโ on our side). We fixed the bug, and
background
is consumed properly by theFont
plugin (and will be handled by this plugin in the UI), andcustom-attribute
is handled by GHS. Therefore, the engine correctly outputs twospan
's.
This is unrelated to the recent fix for background
. It can be reproduced with code as simple as <span custom-attribute="foo" style="color:green;">test</span>
. This is related to the view AttributeElement
priority. These spans could get merged into a single span but those features generate AttributeElements
at different priorities and this makes it non-mergeable. The font color feature uses priority 7
and the generic GHS span uses the default 10
. I'm not sure why we use different priorities for font features. We use 5
for links because they should not get split in HTML if we have part of it formatted, for example, bolded.
As far, we pull the font styles out to prevent situations like this one: https://jsfiddle.net/Lcjzntkd/
๐ Provide detailed reproduction steps (if any)
<span custom-attribute="foo" style="background:red; color:green;">test</span>
โ๏ธ Expected result
In an editor build that contains just GHS, the singular span is retained:
โ Actual result
Once you include FontColor and FontBackgroundColor in the editor, these plugins will take precedence over GHS and a second span will be inserted:
โ Possible solution
This is only reproducible if there's something non-standard in the data that GHS needs to handle separately. In the example above, the issue is not reproducible if your remove
custom-attribute="foo"
from the original data.Possibly related to https://github.com/ckeditor/ckeditor5/issues/15757
๐ Other details
If you'd like to see this fixed sooner, add a ๐ reaction to this post.