You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is the right place to raise this issue, but I encountered an issue with function calls inside a mustache tag in a markdown file. And I was able to recreate this error using the example folder in this repo.
[vite] Internal server error: Error parsing JavaScript expression: Unexpected character '“'. (1:13)
Plugin: vite:vue
File: /home/unplugin/unplugin-vue-markdown/examples/vite/pages/index.md:1:44
2 | title: Hello
3 | meta:
4 | - name: description
| ^
5 | content: Hello World
6 | test: test
at createCompilerError (file:///home/unplugin/unplugin-vue-markdown/node_modules/.pnpm/@[email protected]/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js#cjs:1329:17)
at emitError (file:///home/unplugin/unplugin-vue-markdown/node_modules/.pnpm/@[email protected]/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js#cjs:2822:5)
at createExp (file:///home/unplugin/unplugin-vue-markdown/node_modules/.pnpm/@[email protected]/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js#cjs:2815:7)
at Object.oninterpolation (file:///home/unplugin/unplugin-vue-markdown/node_modules/.pnpm/@[email protected]/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js#cjs:2156:16)
at Tokenizer.stateInterpolationClose (file:///home/unplugin/unplugin-vue-markdown/node_modules/.pnpm/@[email protected]/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js#cjs:546:18)
at Tokenizer.parse (file:///home/unplugin/unplugin-vue-markdown/node_modules/.pnpm/@[email protected]/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js#cjs:1047:16)
at Object.baseParse (file:///home/unplugin/unplugin-vue-markdown/node_modules/.pnpm/@[email protected]/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js#cjs:2861:13)
at Object.parse (file:///home/unplugin/unplugin-vue-markdown/node_modules/.pnpm/@[email protected]/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js#cjs:703:23)
at Object.parse$2 [as parse] (file:///home/unplugin/unplugin-vue-markdown/node_modules/.pnpm/@[email protected]/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js#cjs:1851:24)
at createDescriptor (file:///home/unplugin/unplugin-vue-markdown/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@vitejs/plugin-vue/dist/index.mjs:90:43)
Reproduction Steps (StackBlitz):
Open this repo using stack blitz
Run the following commands:
pnpm i
cd examples/vite
pnpm i
pnpm run dev
Apparently the there is a parser error caused by the examples/vite/README.md, but I'm ignoring it for now by removing the contents inside, might be worth to look at this issue as well.
Edit examples/vite/pages/index.md and add {{ console.log("test") }} anywhere after the frontmatter section of the code. It doesn't have to be console.log("test"), anything that has a string literal will cause an error.
This appears to be an issue with markdown-it converting regular quotes (""'') to typographical quotes (“”‘’) by default, I was able to fix it by adding quotes: '""\'\'' to the configuration. But should this be made the default by the plugin since using literal strings aren't that uncommon? My specific use case was link resolution using {{ $router.resolve("foo/bar").href }}, which by the way doesn't work when put inside a markdown link like this [foo/bar]({{ $router.resolve("foo/bar").href }}), but solving this may be beyond the scope of this plugin.
Describe the bug
I'm not sure if this is the right place to raise this issue, but I encountered an issue with function calls inside a mustache tag in a markdown file. And I was able to recreate this error using the example folder in this repo.
Reproduction Steps (StackBlitz):
pnpm i cd examples/vite pnpm i pnpm run dev
examples/vite/README.md
, but I'm ignoring it for now by removing the contents inside, might be worth to look at this issue as well.examples/vite/pages/index.md
and add{{ console.log("test") }}
anywhere after the frontmatter section of the code. It doesn't have to beconsole.log("test")
, anything that has a string literal will cause an error.Reproduction
https://stackblitz.com/~/github.com/unplugin/unplugin-vue-markdown
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: