Skip to content

Commit a1ced36

Browse files
committed
chore: override text renderer before calling user config
1 parent f86ac56 commit a1ced36

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ examples-temp
1515
node_modules
1616
pnpm-global
1717
TODOs.md
18+
*.timestamp-*.mjs

src/node/markdown/markdown.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,11 @@ export const createMarkdownRenderer = async (
206206

207207
md.linkify.set({ fuzzyLink: false })
208208

209+
// disable entity decode/escape from markdown-it, as the Vue compiler already
210+
// decodes them.
211+
md.disable('entity')
212+
md.renderer.rules.text = (tokens, idx) => tokens[idx].content
213+
209214
if (options.preConfig) {
210215
options.preConfig(md)
211216
}
@@ -292,10 +297,5 @@ export const createMarkdownRenderer = async (
292297
options.config(md)
293298
}
294299

295-
// disable entity decode/escape from markdown-it, as the Vue compiler already
296-
// decodes them.
297-
md.disable('entity')
298-
md.renderer.rules.text = (tokens, idx) => tokens[idx].content
299-
300300
return md
301301
}

0 commit comments

Comments
 (0)