Widget marker conversion handles only classes #7359
Labels
package:widget
resolution:expired
This issue was closed due to lack of feedback.
status:stale
type:bug
This issue reports a buggy (incorrect) behavior.
type:improvement
This issue reports a possible enhancement of an existing feature.
📝 Provide a description of the improvement
When a view element is widgetized, it gets its own handling of markers that are created on that widget. All widgets get that by default. Thanks to that we have borders on images or tables when we add comments or other markers to it.
This is the part of the code that is responsible for that: https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-widget/src/utils.js#L109-L114
As you can see, this mechanism handles only classes. This is different than handling marker conversion for texts: https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/conversion/downcasthelpers.js#L924
For texts, we create a view attribute element from the descriptor and we wrap the text with it. This is very simple:
ckeditor5/packages/ckeditor5-engine/src/conversion/downcasthelpers.js
Line 423 in 4d2f5f9
As you can see, attributes are handled as well (priority does not make sense for non-attribute view elements).
We add
data-comment=""
attribute to for comments markers (in editing downcast). I just noticed that it is not set for widgets. We didn't get any issue reports, though.The text was updated successfully, but these errors were encountered: