chore: override text renderer before calling user config

pull/3807/head
Divyansh Singh 5 months ago
parent f86ac56b78
commit a1ced36553

1
.gitignore vendored

@ -15,3 +15,4 @@ examples-temp
node_modules node_modules
pnpm-global pnpm-global
TODOs.md TODOs.md
*.timestamp-*.mjs

@ -206,6 +206,11 @@ export const createMarkdownRenderer = async (
md.linkify.set({ fuzzyLink: false }) md.linkify.set({ fuzzyLink: false })
// disable entity decode/escape from markdown-it, as the Vue compiler already
// decodes them.
md.disable('entity')
md.renderer.rules.text = (tokens, idx) => tokens[idx].content
if (options.preConfig) { if (options.preConfig) {
options.preConfig(md) options.preConfig(md)
} }
@ -292,10 +297,5 @@ export const createMarkdownRenderer = async (
options.config(md) options.config(md)
} }
// disable entity decode/escape from markdown-it, as the Vue compiler already
// decodes them.
md.disable('entity')
md.renderer.rules.text = (tokens, idx) => tokens[idx].content
return md return md
} }

Loading…
Cancel
Save