-
Notifications
You must be signed in to change notification settings - Fork 39
removeHighlight method now accepts highlight id #1165
Conversation
@@ -445,10 +445,9 @@ export function highlightText( highlightDescriptor ) { | |||
|
|||
/** | |||
* Function factory, creates converter that converts all elements inside marker's range. Converter checks if element has |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converter function factory. Creates a function which applies the marker's highlight to all elements inside a marker's range.
And then:
The converter checks if an element has the
addHighlight
andremoveHighlight
functions stored as {@link TODO custom properties} and if so use them to apply the highlight...
Something like that.
* properties. Those properties are passed `HighlightDescriptor` object upon conversion and should use it to | ||
* change the element. | ||
* properties: | ||
* * `HighlightDescriptor` is passed to `addHighlight` function upon conversion and should be used to apply highlight to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the
addHighlight()
function
@@ -640,8 +639,11 @@ class HighlightAttributeElement extends ViewAttributeElement { | |||
* described by this object. | |||
* | |||
* Each element can handle displaying highlight separately by providing `addHighlight` and `removeHighlight` custom |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the highlight
@@ -640,8 +639,11 @@ class HighlightAttributeElement extends ViewAttributeElement { | |||
* described by this object. | |||
* | |||
* Each element can handle displaying highlight separately by providing `addHighlight` and `removeHighlight` custom | |||
* properties. Those properties are passed `HighlightDescriptor` object upon conversion and should use it to | |||
* change the element. | |||
* properties: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the docs above add prepositions before "highlight" and "content highlight" cause they are used as nouns.
I don't know this code at all so I mainly focused on the docs. I leave the rest to you, @scofalik. |
Please create a PR out of the changes in widgets repository so I can close this PR and those changes together. Unless changes in widgets repo were already closed for some reason. |
Suggested merge commit message (convention)
Other: The
removeHighlight()
function now accepts descriptor id instead of aHighlightDescriptor
object. Closes ckeditor/ckeditor5#4197.BREAKING CHANGE: The
removeHighlight()
function now accepts descriptor id instead of aHighlightDescriptor
object. See ckeditor/ckeditor5#4197.Additional information
Updates to handling highlighting in widgets: https://github.com/ckeditor/ckeditor5-widget/tree/t/ckeditor5-engine/1164.