You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 passAttributeElement
instance. The passed element is then compared with elements from range usingisSimilar
function.Unfortunately, sometimes the elements are pretty complicated. By default, everything gets compared:
name
, attributes, classes andpriority
. 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 givenAttributeElement
s are similar, if they were created bytoHighlight
converter builder. This makes a lot of sense. By defaultdescriptor#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.The text was updated successfully, but these errors were encountered: