Tagscript

TranslateNodes

TagScript


Function: translateNodes()

translateNodes(nodeOrderedList, index, start, differential): void

Defined in: packages/tagscript/src/lib/Interpreter/engine.ts:82

Shifts the coordinates of every node after index by differential, so they still point at their own text after an earlier tag was replaced with something of a different length.

Parameters

nodeOrderedList

Node[]

Every node in the message.

index

number

The index of the node that was just replaced.

start

number

The index the replaced tag started at.

differential

number

By how much the text after the tag shifted.

Returns

void

On this page