add meta to markdown-it env
Is your feature request related to a problem? Please describe.
there is no context info currently, such as filepath/vite compiler, when markdown-it parse markdown files, and this leads to the inability to resolve relative file path when parsing markdown files, or add dependency to compiler to make hmr work as expected
for example, snippet
https://github.com/vuejs/vitepress/blob/ea6cb00c3e9099d45fc236bff0f7c42a65d558dc/src/node/markdown/plugins/snippet.ts?_pjax=%23js-repo-pjax-container%2C%20div%5Bitemtype%3D%22http%3A%2F%2Fschema.org%2FSoftwareSourceCode%22%5D%20main%2C%20%5Bdata-pjax-container%5D#L145-L147
// loader always undefined
if (loader) {
loader.addDependency(src)
}
Describe the solution you'd like
add meta to markdown-it be called) when render
Describe alternatives you've considered
No response
Additional context
No response
Validations
- [X] Follow our Code of Conduct
- [X] Read the docs.
- [X] Read the Contributing Guidelines.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
#869 will add file path in env. Will track that loader thing in #117.