Skip to content

denote

function denote(
value,
callback,
markups): string;

Defined in: packages/core/src/features/parsing/ParserV2/utils/denote.ts:20

Transform annotated text to another text by recursively processing all tokens

ParameterTypeDescription
valuestringAnnotated text to process
callback(mark) => stringFunction to transform each MarkToken
markupsMarkup[]Array of markup patterns to parse

string

Transformed text

const text = '@[Hello](world) and #[nested @[content]]'
const result = denote(text, mark => mark.value, ['@[__value__](__meta__)', '#[__nested__]'])
// Returns: 'Hello and nested content'