# DowncastAddMarkerEvent

typedef

Fired when a new marker is added to the model. Also fired when a collapsed model selection that is inside a marker is converted.

`addMarker` is a namespace for a class of events. Names of actually called events follow this pattern: `addMarker:markerName`. By specifying certain marker names, you can make the events even more gradual. For example, if markers are named `foo:abc`, `foo:bar`, then it is possible to listen to `addMarker:foo` or `addMarker:foo:abc` and `addMarker:foo:bar` events.

If the marker range is not collapsed:

* the event is fired for each item in the marker range one by one,
* `conversionApi.consumable` includes each item of the marker range and the consumable value is same as the event name.

If the marker range is collapsed:

* there is only one event,
* `conversionApi.consumable` includes marker range with the event name.

If the selection inside a marker is converted:

* there is only one event,
* `conversionApi.consumable` includes the selection instance with the event name.

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

#### Value

`DowncastEvent<'addMarker'>`

## Fired by

* [DowncastDispatcher#addMarker](module_engine_conversion_downcastdispatcher-DowncastDispatcher.md#event-addMarker)

---

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