vitepress icon indicating copy to clipboard operation
vitepress copied to clipboard

add meta to markdown-it env

Open kagawagao opened this issue 4 years ago • 1 comments

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

kagawagao avatar Nov 16 '21 09:11 kagawagao

#869 will add file path in env. Will track that loader thing in #117.

brc-dd avatar Jul 07 '22 08:07 brc-dd