MarkView
By default, document marks are rendered using the result of the
toDOM method of their spec, and managed entirely
by the editor. For some use cases, you want more control over the behavior
of a mark's in-editor representation, and need to
define a custom mark view.
Objects returned as mark views must conform to this interface.
interface MarkView {
contentDOM?: HTMLElement | null;
destroy?: () => void;
dom: DOMNode;
ignoreMutation?: (mutation: ViewMutationRecord) => boolean;
}§Properties
§
contentDOM?: HTMLElement | null
[src]The DOM node that should hold the mark's content. When this is not
present, the dom property is used as the content DOM.
§
destroy?: () => void
[src]Called when the mark view is removed from the editor or the whole editor is destroyed.
§
ignoreMutation?: (mutation: ViewMutationRecord) => boolean
[src]Called when a mutation happens within the view. Return false if the editor should re-read the selection or re-parse the range around the mutation, true if it can safely be ignored.