Skip to content

Commit

Permalink
fix: snippet plugin root params Missing default value vuejs#204
Browse files Browse the repository at this point in the history
  • Loading branch information
hcg1023 committed Feb 10, 2021
1 parent 122e026 commit 2f67a59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/node/markdown/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export interface MarkdownRenderer {
}

export const createMarkdownRenderer = (
options: MarkdownOptions = {}
options: MarkdownOptions = {},
root: string
): MarkdownRenderer => {
const md = MarkdownIt({
html: true,
Expand All @@ -55,7 +56,7 @@ export const createMarkdownRenderer = (
md.use(componentPlugin)
.use(highlightLinePlugin)
.use(preWrapperPlugin)
.use(snippetPlugin)
.use(snippetPlugin, root)
.use(hoistPlugin)
.use(containerPlugin)
.use(extractHeaderPlugin)
Expand Down
2 changes: 1 addition & 1 deletion src/node/markdownToVue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function createMarkdownToVueRenderFn(
root: string,
options: MarkdownOptions = {}
) {
const md = createMarkdownRenderer(options)
const md = createMarkdownRenderer(options, root)

return (src: string, file: string): MarkdownCompileResult => {
const relativePath = slash(path.relative(root, file))
Expand Down

0 comments on commit 2f67a59

Please sign in to comment.