typing/utils/findattributerange
module
Functions
findAttributeRange( position, attributeName, value, model ) → ModelRangemodule:typing/utils/findattributerange~findAttributeRangeReturns a model range that covers all consecutive nodes with the same
attributeNameand itsvaluethat intersect the givenposition.It can be used e.g. to get the entire range on which the
linkHrefattribute needs to be changed when having a selection inside a link.Parameters
position : ModelPositionThe start position.
attributeName : stringThe attribute name.
value : unknownThe attribute value.
model : ModelThe model instance.
Returns
ModelRangeThe link range.
findAttributeRangeBound( position, attributeName, value, lookBack, model ) → ModelPositionmodule:typing/utils/findattributerange~findAttributeRangeBoundWalks forward or backward (depends on the
lookBackflag), node by node, as long as they have the same attribute value and returns a position just before or after (depends on thelookBackflag) the last matched node.Parameters
position : ModelPositionThe start position.
attributeName : stringThe attribute name.
value : unknownThe attribute value.
lookBack : booleanWhether the walk direction is forward (
false) or backward (true).model : Model
Returns
ModelPositionThe position just before the last matched node.