Skip to content

getTokenOffset

getTokenOffset(editor, token): number

Defined in: utils/index.ts:251

Computes the offset at which the specified token begins in the editor’s value.

Editor or code block the token is inside.

PrismEditor<{ }> | PrismCodeBlock

HTMLSpanElement

Token to compute the offset for.

number

If the token isn’t inside the specified editor.