Skip to content

Commit

Permalink
chore: override text renderer before calling user config
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Apr 18, 2024
1 parent f86ac56 commit a1ced36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ examples-temp
node_modules
pnpm-global
TODOs.md
*.timestamp-*.mjs
10 changes: 5 additions & 5 deletions src/node/markdown/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ export const createMarkdownRenderer = async (

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) {
options.preConfig(md)
}
Expand Down Expand Up @@ -292,10 +297,5 @@ export const createMarkdownRenderer = async (
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
}

0 comments on commit a1ced36

Please sign in to comment.