Skip to main content

Class: SurroundingPairStage

processTargets/modifiers/SurroundingPairStage.SurroundingPairStage

Applies the surrounding pair modifier to the given selection. First looks to see if the target is itself adjacent to or contained by a modifier token. If so it will expand the selection to the opposite delimiter token. Otherwise, or if the opposite token wasn't found, it will proceed by finding the smallest pair of delimiters which contains the selection.

param Context to be leveraged by modifier

param The selection to process

param The surrounding pair modifier information

returns The new selection expanded to the containing surrounding pair or null if none was found

Implements

Constructors

constructor

new SurroundingPairStage(modifier)

Parameters

NameType
modifierSurroundingPairModifier

Defined in

processTargets/modifiers/SurroundingPairStage.ts:25

Methods

run

run(context, target): SurroundingPairTarget[]

Parameters

NameType
contextProcessedTargetsContext
targetTarget

Returns

SurroundingPairTarget[]

Implementation of

ModifierStage.run

Defined in

processTargets/modifiers/SurroundingPairStage.ts:27