Skip to content

annotate

function annotate(markup, params): string;

Defined in: core/src/features/parsing/parser/utils/annotate.ts:18

Make annotation from the markup for ParserV2

ParameterTypeDescription
markupMarkupMarkup pattern with value, meta, and/or slot placeholders
params{ meta?: string; slot?: string; value?: string; }Object with optional value, meta, and slot strings
params.meta?string-
params.slot?string-
params.value?string-

string

Annotated string with placeholders replaced

annotate('@[__value__]', { value: 'Hello' }) // '@[Hello]'
annotate('@[__value__](__meta__)', { value: 'Hello', meta: 'world' }) // '@[Hello](world)'
annotate('@[__slot__]', { slot: 'content' }) // '@[content]'