Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use HighlightDescriptor#id when marker over text nodes is converted #4165

Closed
scofalik opened this issue Aug 28, 2017 · 0 comments · Fixed by ckeditor/ckeditor5-engine#1109
Closed
Assignees
Labels
package:engine type:improvement This issue reports a possible enhancement of an existing feature.
Milestone

Comments

@scofalik
Copy link
Contributor

Highlight nicely solves some issues connected with creating converters for markers. However there is still one issue, which we might easily address tweaking a bit the mechanisms we created.

At the moment, when we remove a marker, or any attribute element, we use view.writer#unwrap. To know which attribute element should be unwrapped, we pass AttributeElement instance. The passed element is then compared with elements from range using isSimilar function.

Unfortunately, sometimes the elements are pretty complicated. By default, everything gets compared: name, attributes, classes and priority. Sometimes it is a bit tricky to write converter/element creator function to create proper similar element. Sometimes elements base not only on model but some other sources of data.

This should be easier. I propose to use descriptor#id to compare whether given AttributeElements are similar, if they were created by toHighlight converter builder. This makes a lot of sense. By default descriptor#id is a marker name, which was converted. If later we remove the marker, we want to unwrap everything that is connected with that marker name.

@scofalik scofalik self-assigned this Aug 28, 2017
szymonkups referenced this issue in ckeditor/ckeditor5-engine Aug 30, 2017
Feature: Highlights on text nodes will be now unwrapped basing on descriptor id (which by default is marker name). Closes #1108.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-engine Oct 9, 2019
@mlewand mlewand added this to the iteration 11 milestone Oct 9, 2019
@mlewand mlewand added module:conversion type:improvement This issue reports a possible enhancement of an existing feature. package:engine labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:engine type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants