Skip to content

Commit

Permalink
fix: avoid unexpected vite define replacements in markdown content
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 1, 2021
1 parent 8769b4b commit a41928e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/node/markdownToVue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ export function createMarkdownToVueRenderFn(
const start = Date.now()

const { content, data: frontmatter } = matter(src)
const { html, data } = md.render(content)
let { html, data } = md.render(content)

// avoid env variables being replaced by vite
html = html
.replace(/import\.meta/g, 'import.<wbr/>meta')
.replace(/process\.env/g, 'process.<wbr/>env')

// TODO validate data.links?
const pageData: PageData = {
Expand Down

0 comments on commit a41928e

Please sign in to comment.