Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

removeHighlight method now accepts highlight id #1165

Merged
merged 2 commits into from
Oct 16, 2017
Merged

removeHighlight method now accepts highlight id #1165

merged 2 commits into from
Oct 16, 2017

Conversation

szymonkups
Copy link
Contributor

@szymonkups szymonkups commented Oct 11, 2017

Suggested merge commit message (convention)

Other: The removeHighlight() function now accepts descriptor id instead of a HighlightDescriptor object. Closes ckeditor/ckeditor5#4197.

BREAKING CHANGE: The removeHighlight() function now accepts descriptor id instead of a HighlightDescriptor object. See ckeditor/ckeditor5#4197.


Additional information

Updates to handling highlighting in widgets: https://github.com/ckeditor/ckeditor5-widget/tree/t/ckeditor5-engine/1164.

@@ -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
Copy link
Member

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 and removeHighlight 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
Copy link
Member

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
Copy link
Member

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:
Copy link
Member

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.

@Reinmar
Copy link
Member

Reinmar commented Oct 11, 2017

I don't know this code at all so I mainly focused on the docs. I leave the rest to you, @scofalik.

@scofalik
Copy link
Contributor

scofalik commented Oct 16, 2017

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.

@szymonkups
Copy link
Contributor Author

Done: ckeditor/ckeditor5-widget#22

@scofalik scofalik merged commit 7bde6f7 into master Oct 16, 2017
@scofalik scofalik deleted the t/1164 branch October 16, 2017 09:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Removing highlight from element should only require highlight id
3 participants