@@ -444,15 +444,15 @@ export function highlightText( highlightDescriptor ) {
444
444
}
445
445
446
446
/**
447
- * Function factory, creates converter that converts all elements inside marker's range. Converter checks if element has
448
- * functions stored under `addHighlight` and `removeHighlight` custom properties and calls them passing
449
- * {@link module:engine/conversion/model-to-view-converters~HighlightDescriptor} . In such case converter will consume
450
- * all element's children, assuming that they were handled by element itself. If highlight descriptor will not provide
451
- * priority, priority `10` will be used as default, to be compliant with
447
+ * Converter function factory. Creates a function which applies the marker's highlight to all elements inside a marker's range.
448
+ * The converter checks if an element has the addHighlight and removeHighlight functions stored as
449
+ * {@link TODO custom properties} and if so use them to apply the highlight . In such case converter will consume all
450
+ * element's children, assuming that they were handled by element itself.
451
+ * If the highlight descriptor will not provide priority, priority `10` will be used as default, to be compliant with
452
452
* {@link module:engine/conversion/model-to-view-converters~highlightText} method which uses default priority of
453
453
* {@link module:engine/view/attributeelement~AttributeElement}.
454
454
*
455
- * If highlight descriptor will not provide `id` property, name of the marker will be used.
455
+ * If the highlight descriptor will not provide `id` property, name of the marker will be used.
456
456
* When `addHighlight` and `removeHighlight` custom properties are not present, element is not converted
457
457
* in any special way. This means that converters will proceed to convert element's child nodes.
458
458
*
@@ -496,7 +496,7 @@ export function highlightElement( highlightDescriptor ) {
496
496
consumable . consume ( value . item , evt . name ) ;
497
497
}
498
498
499
- viewElement . getCustomProperty ( highlightHandlingMethod ) ( viewElement , descriptor ) ;
499
+ viewElement . getCustomProperty ( highlightHandlingMethod ) ( viewElement , addMarker ? descriptor : descriptor . id ) ;
500
500
}
501
501
} ;
502
502
}
@@ -634,14 +634,17 @@ class HighlightAttributeElement extends ViewAttributeElement {
634
634
}
635
635
636
636
/**
637
- * Object describing how content highlight should be created in the view.
637
+ * Object describing how the content highlight should be created in the view.
638
638
*
639
- * Each text node contained in highlight will be wrapped with `span` element with CSS class(es), attributes and priority
639
+ * Each text node contained in the highlight will be wrapped with `span` element with CSS class(es), attributes and priority
640
640
* described by this object.
641
641
*
642
- * Each element can handle displaying highlight separately by providing `addHighlight` and `removeHighlight` custom
643
- * properties. Those properties are passed `HighlightDescriptor` object upon conversion and should use it to
644
- * change the element.
642
+ * Each element can handle displaying the highlight separately by providing `addHighlight` and `removeHighlight` custom
643
+ * properties:
644
+ * * `HighlightDescriptor` is passed to the `addHighlight` function upon conversion and should be used to apply the highlight to
645
+ * the element,
646
+ * * descriptor id is passed to the `removeHighlight` function upon conversion and should be used to remove the highlight of given
647
+ * id from the element.
645
648
*
646
649
* @typedef {Object } module:engine/conversion/model-to-view-converters~HighlightDescriptor
647
650
*
0 commit comments