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.
Parameters
Section titled “Parameters”editor
Section titled “editor”Editor or code block the token is inside.
PrismEditor<{ }> | PrismCodeBlock
HTMLSpanElement
Token to compute the offset for.
Returns
Section titled “Returns”number
Throws
Section titled “Throws”If the token isn’t inside the specified editor.