Skip to content

annotate

function annotate(markup, params): string;

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

Make annotation from the markup for ParserV2

ParameterTypeDescription
markupMarkupMarkup pattern with value, meta, and/or nested placeholders
params{ meta?: string; nested?: string; value?: string; }Object with optional value, meta, and nested strings
params.meta?string-
params.nested?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('@[__nested__]', { nested: 'content' }) // '@[content]'