Custom plugin
You can use Marked extensions, or use an object with 'transform(content)' to rewrite the string before parsing. Customize the tag and then use the 'components' mapping.
String transform
plugin
Ship the TODO before Friday.
Marked extension: footnotes
Next, use tokenizer / renderer to convert [^n] to <footnote>, then map it to a component with Popover.
XMarkdown supports custom marked extensions.1
Map the generated tag with components for interaction.2
See the plugins page for Latex / Highlight / Mermaid.3
Division of work with components
| Method | Stage | Function |
|---|---|---|
config.extensions / marked plugin | Markdown → HTML | Recognize new syntax, output HTML tags |
plugins[].transform | Before parsing | Rewrite as plain string |
components | HTML → VNode | Replace tags with Vue components |
For more API details, see Code Examples · FAQ.