Skip to content

PrismToken

Unofficial

Represents a parsed token produced by Prism’s tokenizer.

Import:

import type { PrismToken } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export class PrismToken

Properties

PropertyTypeDescription
aliasstring | string[]Alias name(s) for the token type.
contentPrismToken[] | stringThe content of the token, either a string or nested tokens.
greedybooleanWhether the token was matched greedily.
lengthnumberThe length of the matched string.
typestringThe type of the token.

Methods

MethodReturnsDescription
stringify(o, language, parent?)stringConverts a token or token stream to an HTML string.

Links to this page: