DowncastHighlightDescriptor
An object describing how the marker highlight should be represented in the view.
Each text node contained in a highlighted range will be wrapped in a <span> view attribute element with CSS class(es), attributes and a priority described by this object.
Additionally, each container element can handle displaying the highlight separately by providing the addHighlight and removeHighlight custom properties. In this case:
- The
DowncastHighlightDescriptorobject is passed to theaddHighlightfunction upon conversion and should be used to apply the highlight to the element. - The descriptor
idis passed to theremoveHighlightfunction upon conversion and should be used to remove the highlight with the given ID from the element.
Properties
attributes : Record<string, string> | undefinedmodule:engine/conversion/downcasthelpers~DowncastHighlightDescriptor#attributesAttributes to set. If the descriptor is used to create an attribute element over text nodes, these attributes will be set on that attribute element. If the descriptor is applied to an element, usually these attributes will be set on that element, however, this depends on how the element converts the descriptor.
classes : string | Array<string>module:engine/conversion/downcasthelpers~DowncastHighlightDescriptor#classesA CSS class or an array of classes to set. If the descriptor is used to create an attribute element over text nodes, these classes will be set on that attribute element. If the descriptor is applied to an element, usually these classes will be set on that element, however, this depends on how the element converts the descriptor.
id : string | undefinedmodule:engine/conversion/downcasthelpers~DowncastHighlightDescriptor#idDescriptor identifier. If not provided, it defaults to the converted marker's name.
priority : number | undefinedmodule:engine/conversion/downcasthelpers~DowncastHighlightDescriptor#priorityDescriptor priority. If not provided, it defaults to
10. If the descriptor is used to create an attribute element, it will be that element's priority. If the descriptor is applied to an element, the priority will be used to determine which descriptor is more important.