Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown Intellisense Randomly Breaks When Containing Latex #4528

Open
4 tasks done
Locietta opened this issue Jan 28, 2025 · 1 comment
Open
4 tasks done

Markdown Intellisense Randomly Breaks When Containing Latex #4528

Locietta opened this issue Jan 28, 2025 · 1 comment
Labels
upstream Related to the dependencies

Comments

@Locietta
Copy link

Locietta commented Jan 28, 2025

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>

Image

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

@Locietta Locietta added the bug: pending triage Maybe a bug, waiting for confirmation label Jan 28, 2025
@brc-dd brc-dd added upstream Related to the dependencies and removed bug: pending triage Maybe a bug, waiting for confirmation labels Jan 28, 2025
@brc-dd
Copy link
Member

brc-dd commented Jan 28, 2025

Please create an issue at language-tools repo. They probably should skip latex blocks/inline equations similar to code fences. These regexes will need change - https://github.com/vuejs/language-tools/blob/07a1baa85e0fdb8d2546e11c8f3b5f8514261e75/packages/language-core/lib/plugins/file-md.ts#L8-L9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Related to the dependencies
Projects
None yet
Development

No branches or pull requests

2 participants