Skip to content

ckeditor5-elements / getAncestorElements

Function: getAncestorElements() ​

ts
function getAncestorElements(node): Generator<ModelElement>;

Returns the element and its ancestors, the inner first, up to the root, which is not one of them: the elements that a node is, or is in. Nothing for a root, a document fragment, or null.

Parameters ​

ParameterType
node| ModelElement | ModelDocumentFragment | null | undefined

Returns ​

Generator<ModelElement>