From 1f4ae02138820f2ee78ce6ce39847cdfd0ba19ca Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Tue, 15 Aug 2023 14:56:28 +0530 Subject: [PATCH] docs: update mdit config to use import --- docs/guide/markdown.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/guide/markdown.md b/docs/guide/markdown.md index e20e864f..3b197e4b 100644 --- a/docs/guide/markdown.md +++ b/docs/guide/markdown.md @@ -783,14 +783,15 @@ Note that this does not throw errors if your file is not present. Hence, when us VitePress uses [markdown-it](https://github.com/markdown-it/markdown-it) as the Markdown renderer. A lot of the extensions above are implemented via custom plugins. You can further customize the `markdown-it` instance using the `markdown` option in `.vitepress/config.js`: ```js -const anchor = require('markdown-it-anchor') +import markdownItAnchor from 'markdown-it-anchor' +import markdownItFoo from 'markdown-it-foo' module.exports = { markdown: { // options for markdown-it-anchor // https://github.com/valeriangalliat/markdown-it-anchor#usage anchor: { - permalink: anchor.permalink.headerLink() + permalink: markdownItAnchor.permalink.headerLink() }, // options for @mdit-vue/plugin-toc @@ -799,7 +800,7 @@ module.exports = { config: (md) => { // use more markdown-it plugins! - md.use(require('markdown-it-xxx')) + md.use(markdownItFoo) } } }