Skip to content

Commit 9949f00

Browse files
authored
fix(build): cannot handle file name containing single quote (#2615)
1 parent 5ffaa56 commit 9949f00

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: src/node/markdownToVue.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,16 @@ function injectPageDataCode(
322322
code +
323323
(hasDefaultExport
324324
? ``
325-
: `\nexport default {name:'${data.relativePath}'}`) +
325+
: `\nexport default {name:${JSON.stringify(data.relativePath)}}`) +
326326
`</script>`
327327
)
328328
} else {
329329
tags.unshift(
330-
`<script ${isUsingTS ? 'lang="ts"' : ''}>${code}\nexport default {name:'${
330+
`<script ${
331+
isUsingTS ? 'lang="ts"' : ''
332+
}>${code}\nexport default {name:${JSON.stringify(
331333
data.relativePath
332-
}'}</script>`
334+
)}}</script>`
333335
)
334336
}
335337

0 commit comments

Comments
 (0)