annotate
function annotate(markup, params): string;Defined in: core/src/features/parsing/parser/utils/annotate.ts:18
Make annotation from the markup for ParserV2
Parameters
Section titled “Parameters”| 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 | - |
Returns
Section titled “Returns”string
Annotated string with placeholders replaced
Example
Section titled “Example”annotate('@[__value__]', { value: 'Hello' }) // '@[Hello]'annotate('@[__value__](__meta__)', { value: 'Hello', meta: 'world' }) // '@[Hello](world)'annotate('@[__slot__]', { slot: 'content' }) // '@[content]'