JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://wzrd.in/standalone/markdown-it@latest"></script>
<script src="https://wzrd.in/standalone/markdown-it-anchor@latest"></script>
<script src="https://wzrd.in/standalone/html@latest"></script>
<pre id="pre"></pre>
JavaScript
// Globals from wzrd.in (Browserify as a service).
const md = markdownIt()
md.use(markdownItAnchor, {
level: 1,
// slugify: string => string,
permalink: false,
// renderPermalink: (slug, opts, state, permalink) => {},
permalinkClass: 'header-anchor',
permalinkSymbol: '¶',
permalinkBefore: false
})
const src = `# First header
Lorem ipsum.
## Next section!
This is totaly awesome.`
pre.textContent = html.prettyPrint(md.render(src))