Open RSS1102 opened 6 months ago
You can do something like this:
// .vitepress/config.ts
import { defineConfig } from 'vitepress'
export default defineConfig({
markdown: {
config(md) {
md.render = function (src, env) {
return yourRenderer(src, env) // return html string from here, you'll need to set some stuff in env too
}
}
}
})
Will this be sufficient for you? Or can you explain in bit detail what you're trying to do?
Is your feature request related to a problem? Please describe.
I used an sever API that can convert
*.md
strings into HTML elements. I want it to replace the parsing ofmarkdown-it
.Display the parsed markup content on the page.Describe the solution you'd like
Can
markdown-it
serve as a pluggable markdown parser? can be replaced with other markup parsers.Describe alternatives you've considered
Alternatively, have a hook from the
*.md
string to the page content using an API, and skip the parsing of themarkdown-it
.Additional context
No response
Validations