typing/utils/findattributerange
@ckeditor/ckeditor5-typing/src/utils/findattributerange
Filtering
Functions
-
findAttributeRange( position, attributeName, value, model ) → Range
module:typing/utils/findattributerange~findAttributeRange
Returns a model range that covers all consecutive nodes with the same
attributeName
and itsvalue
that intersect the givenposition
.It can be used e.g. to get the entire range on which the
linkHref
attribute needs to be changed when having a selection inside a link.Parameters
position : Position
The start position.
attributeName : string
The attribute name.
value : unknown
The attribute value.
model : Model
The model instance.
Returns
Range
The link range.
-
findAttributeRangeBound( position, attributeName, value, lookBack, model ) → Position
module:typing/utils/findattributerange~findAttributeRangeBound
Walks forward or backward (depends on the
lookBack
flag), node by node, as long as they have the same attribute value and returns a position just before or after (depends on thelookBack
flag) the last matched node.Parameters
position : Position
The start position.
attributeName : string
The attribute name.
value : unknown
The attribute value.
lookBack : boolean
Whether the walk direction is forward (
false
) or backward (true
).model : Model
Returns
Position
The position just before the last matched node.
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.