/* eslint-disable @typescript-eslint/no-var-requires */ import type MarkdownIt from 'markdown-it'; import type Token from 'markdown-it/lib/token'; const container = require('markdown-it-container'); export const containerPlugin = (md: MarkdownIt) => { md.use(...createContainer('tip', 'TIP')) .use(...createContainer('warning', 'WARNING')) .use(...createContainer('danger', 'WARNING')) // explicitly escape Vue syntax .use(container, 'v-pre', { render: (tokens: Token[], idx: number) => tokens[idx].nesting === 1 ? `
${ info || defaultTitle }
\n`; } else { return `