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

Property Type Description
alias string | string[] Alias name(s) for the token type.
content PrismToken[] | string The content of the token, either a string or nested tokens.
greedy boolean Whether the token was matched greedily.
length number The length of the matched string.
type string The type of the token.

Methods

Method Returns Description
stringify(o, language, parent?) string Converts a token or token stream to an HTML string.

Links to this page: