<script>import uslug from'uslug'import MarkdownIt from'markdown-it'import markdownItTocAndAnchor from'markdown-it-toc-and-anchor'data () {return{ mdStr:'相关md字符串', htmlStr:'',//渲染到页面tocArray: [], tocShow: [],//渲染到页面isFirstClickDir:true, curContentScrollTop:2} }, co...
markdownItTocAndAnchor=require('markdown-it-toc-and-anchor').default; markdownIt({ html:true, linkify:true, typographer:true, }) .use(markdownItTocAndAnchor,{ // ...options }) .render(md) ``` ℹ️Note that the 'default' property has to be used when requiring this plugin, this ...
varmarkdownIt=require('markdown-it'),markdownItTocAndAnchor=require('markdown-it-toc-and-anchor').default;markdownIt({html:true,linkify:true,typographer:true,}).use(markdownItTocAndAnchor,{// ...options}).render(md) ℹ️ Note that the 'default' property has to be used when requiring...
Take for example the three most popular, at the time of writing this README, solutions for this problem:markdown-it-toc-and-anchor,markdown-it-table-of-contents,markdown-it-toc. They all implement their TOC asinlineand, most obscure of all, after theemphasisrule. Does it make any sense...
<script>import uslug from'uslug'import MarkdownIt from'markdown-it'import markdownItTocAndAnchor from'markdown-it-toc-and-anchor'data () {return{ mdStr:'相关md字符串', htmlStr:'',//渲染到页面tocArray: [], tocShow: [],//渲染到页面isFirstClickDir:true, ...
var markdownIt = require('markdown-it'), markdownItTocAndAnchor = require('markdown-it-toc-and-anchor').default; markdownIt({ html: true, linkify: true, typographer: true, }) .use(markdownItTocAndAnchor, { // ...options }) .render(md)...