# DowncastHighlightDescriptor

interface

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](module_engine_view_attributeelement-ViewAttributeElement.md) with CSS class(es), attributes and a priority described by this object.

Additionally, each [container element](module_engine_view_containerelement-ViewContainerElement.md) can handle displaying the highlight separately by providing the `addHighlight` and `removeHighlight` custom properties. In this case:

* The `DowncastHighlightDescriptor` object is passed to the `addHighlight` function upon conversion and should be used to apply the highlight to the element.
* The descriptor `id` is passed to the `removeHighlight` function upon conversion and should be used to remove the highlight with the given ID from the element.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/conversion/downcasthelpers.ts#L2949)

<a id="properties">

## Properties

<a id="member-attributes">

### `attributes?: Record<string, string>`

Attributes to set. If the descriptor is used to create an [attribute element](module_engine_view_attributeelement-ViewAttributeElement.md) 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.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/conversion/downcasthelpers.ts#L2978)

<a id="member-classes">

### `classes: string | Array<string>`

A CSS class or an array of classes to set. If the descriptor is used to create an [attribute element](module_engine_view_attributeelement-ViewAttributeElement.md) 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.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/conversion/downcasthelpers.ts#L2957)

<a id="member-id">

### `id?: string`

Descriptor identifier. If not provided, it defaults to the converted marker's name.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/conversion/downcasthelpers.ts#L2962)

<a id="member-priority">

### `priority?: number`

Descriptor priority. If not provided, it defaults to `10`. If the descriptor is used to create an [attribute element](module_engine_view_attributeelement-ViewAttributeElement.md), it will be that element's [priority](module_engine_view_attributeelement-ViewAttributeElement.md#member-priority). If the descriptor is applied to an element, the priority will be used to determine which descriptor is more important.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/conversion/downcasthelpers.ts#L2970)

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
