Skip to content

annotate

function annotate(markup, params): string;

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

Make annotation from the markup for Parser

Parameter Type Description
markup Markup Markup 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]'