diff --git a/.gitignore b/.gitignore index 0e9bd5c8..2a5cb454 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ dist node_modules TODOs.md -.vscode \ No newline at end of file +.vscode +.idea \ No newline at end of file diff --git a/src/node/markdown/markdown.ts b/src/node/markdown/markdown.ts index 3338b240..1d8937f7 100644 --- a/src/node/markdown/markdown.ts +++ b/src/node/markdown/markdown.ts @@ -94,9 +94,9 @@ export const createMarkdownRenderer = ( // wrap render so that we can return both the html and extracted data. const render = md.render - const wrappedRender: MarkdownRenderer['render'] = (src) => { + const wrappedRender: MarkdownRenderer['render'] = (src,env={}) => { ;(md as any).__data = {} - const html = render.call(md, src) + const html = render.call(md, src,env) return { html, data: (md as any).__data diff --git a/src/node/markdownToVue.ts b/src/node/markdownToVue.ts index bc01c15d..3079818e 100644 --- a/src/node/markdownToVue.ts +++ b/src/node/markdownToVue.ts @@ -65,7 +65,7 @@ export function createMarkdownToVueRenderFn( }) const { content, data: frontmatter } = matter(src) - let { html, data } = md.render(content) + let { html, data } = md.render(content,{file}) if (isBuild) { // avoid env variables being replaced by vite