A markdown-it plugin to help transforming markdown to vue sfc
npm install @mdit-vue/plugin-sfc

A markdown-it plugin to help transforming markdown to Vue SFC.
- Avoids rendering and tags and extract them into to markdown-it env.sfcBlocks.
- Supports extracting custom blocks.
- Provides env.sfcBlocks.template for convenience.
``sh`
npm i @mdit-vue/plugin-sfc
This plugin will only take effects when the html option of markdown-it is enabled:
`ts
import { sfcPlugin } from '@mdit-vue/plugin-sfc';
import type { MarkdownItEnv } from '@mdit-vue/types';
import MarkdownIt from 'markdown-it';
const md = MarkdownIt({ html: true }).use(sfcPlugin, {
// options
});
const env: MarkdownItEnv = {};
const rendered = md.render(
\
,
env,
);
console.log(env.sfcBlocks);
`
- Type: string[]
- Default: []
- Details:
SFC custom blocks to be extracted.
By default, only