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
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
markup | Markup | Markup 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 | - |
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('@[__nested__]', { nested: 'content' }) // '@[content]'