-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Describe the bug
Inside LaTeX math expressions in Slidev ($...$ or $$...$$), any occurrence of \{\{ is incorrectly treated by Vue's template compiler as the beginning of a mustache interpolation block ({{ ... }}).
As a result, the math formula breaks, parts of it disappear, or Slidev shows a compile error.
In LaTeX, \{\{ is a valid way to typeset literal braces or appears inside certain macro uses, so it should be passed through to KaTeX/MathJax unchanged.
Instead, Slidev/Vite parses it too early as a Vue template expression.
Expected behavior
\{\{ inside math mode should not be interpreted as Vue {{ ... }} interpolation and should be forwarded verbatim to the math engine.
Minimal reproduction
-
Create a new Slidev project (
npm create slidev@latestor https://sli.dev/new) -
Add a slide with the following content:
$$ f(x) = \{\{ x \}\} $$
-
Run
npm run dev -
The slide fails to render because Vue treats
{{ x }}as a mustache expression instead of literal math.
Environment
- Slidev version: v52.4.0
- Browser: Chrome
- OS: Windows 10