Upcasting a $text element over an already upcasted property should work #13383
Labels
resolution:expired
This issue was closed due to lack of feedback.
type:bug
This issue reports a buggy (incorrect) behavior.
📝 Provide detailed reproduction steps (if any)
This is related to Upcasting an element that has multiple attributes may not work #4306 and it might be considered a feature request instead of a bug.
Summary: Issue #4306 solved a bug where multiple upcasts couldn't address the same
$text
element because the first one to act would consume the tagname.The solution was to consume the item when
view
only specifiesname
and, if not, consume the property/properties (i.e class, ID, data-attribute, etc)The problem is that this also prevents upcasting the same property several times, which might make sense for plugins wanting to act independently of each other on the same properties.
Scenario we use a plugin that stores on
linkClass
any existing link classes on an attribute to expose an UI for handling them. This upcast acts ona
elements withclasses: true
.We have another plugin that looks for an specific class to populate a
linkSize
attribute. This upcast acts ona
classes that have an specific class:✔️ Expected result
Data upcasting should populate both attributes:
❌ Actual result
Data upcasting will only happen for the first occurence (or higher priority) upcast. It will consume the
a.classes
and further upcasts will fail to act.❓ Possible solution
Don't consume $text properties. Of course I'm aware that this might have tons of architectural implications but at the same time I find counterintuitive the idea that each element property can be consumed only once.
Provide developers with an API or a way to easily "bypass" property consumption.
...or maybe Iim just missing something.
📃 Other details
CKEDITOR_VERSION: 36.0.0
Installed plugins: Essentials, Paragraph, Heading, List, Bold, Italic, Link and a custom testing plugin that pretty much includes the aforementioned code.
If you'd like to see this fixed sooner, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: