Open
Description
Describe the bug
I've followed https://vitepress.dev/guide/using-vue#vs-code-intellisense-support to enable intellisense in markdown files. But current intellisense may not work properly when there're Latex contents.
Reproduction
It's kinda hard to reproduce though, it randomly occurs for me. And adding spaces in between may or may not resolve the intellisense error. But the problematic intellisense tends to happen when there's <somevar\somecommand
(invalid character), \
(':' is expected), xxx$.
(parsed as variable)
Used markdown from #4290 as the template:
---
hello: world
---
<script setup>
import { ref } from 'vue'
const count = ref(0)
</script>
## Title
The count is: {{ count }}
<button :class="$style.button" @click="count++">Increment</button>
$$
<p_i\leq
$$
$xxx$.
$\ $
<style module>
.button {
color: red;
font-weight: bold;
}
</style>
Expected behavior
The intellisense in markdown files should be more robust and can handle these cases when Latex content is presented in the posts.
System Info
System:
OS: Windows 11 10.0.26100
CPU: (16) x64 AMD Ryzen 7 7435HS
Memory: 7.24 GB / 23.74 GB
Binaries:
Node: 23.6.1 - D:\Scoop\apps\nodejs\current\node.EXE
npm: 10.9.2 - D:\Scoop\apps\nodejs\current\npm.CMD
pnpm: 10.0.0 - D:\Scoop\shims\pnpm.EXE
Browsers:
Edge: Chromium (130.0.2849.68)
Internet Explorer: 11.0.26100.1882
npmPackages:
vitepress: 1.5.0 => 1.5.0
Additional context
No response
Validations
- Check if you're on the latest VitePress version.
- Follow our Code of Conduct
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.