mirror of
https://github.com/wahyd4/docsify.git
synced 2026-08-15 16:26:07 +10:00
Strip HTML tag when rendering the headling
This commit is contained in:
+1
-1
@@ -19,7 +19,7 @@ const renderer = new marked.Renderer()
|
||||
* @link https://github.com/chjj/marked#overriding-renderer-methods
|
||||
*/
|
||||
renderer.heading = function (text, level) {
|
||||
const slug = text.toLowerCase().replace(/[\s\n\t]+/g, '-')
|
||||
const slug = text.replace(/<(?:.|\n)*?>/gm, '').toLowerCase().replace(/[\s\n\t]+/g, '-')
|
||||
|
||||
toc.push({ level, slug, title: text })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user