Skip to content

Commit 2aa8ab2

Browse files
hcg1023kiaking
andauthored
fix: @ alias for import code snippet being always undefined (#204)
Co-authored-by: Kia King Ishii <[email protected]>
1 parent 7ceaf34 commit 2aa8ab2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/node/markdown/markdown.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export interface MarkdownRenderer {
4242
}
4343

4444
export const createMarkdownRenderer = (
45+
root: string,
4546
options: MarkdownOptions = {}
4647
): MarkdownRenderer => {
4748
const md = MarkdownIt({
@@ -55,7 +56,7 @@ export const createMarkdownRenderer = (
5556
md.use(componentPlugin)
5657
.use(highlightLinePlugin)
5758
.use(preWrapperPlugin)
58-
.use(snippetPlugin)
59+
.use(snippetPlugin, root)
5960
.use(hoistPlugin)
6061
.use(containerPlugin)
6162
.use(extractHeaderPlugin)

src/node/markdownToVue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function createMarkdownToVueRenderFn(
1919
root: string,
2020
options: MarkdownOptions = {}
2121
) {
22-
const md = createMarkdownRenderer(options)
22+
const md = createMarkdownRenderer(root, options)
2323

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

0 commit comments

Comments
 (0)