-
|
I've noticed that in VS Code with regular Markdown syntax highlighting, using a template expression will break (actually toggle) syntax highlighting of any subsequent code blocks. In this example, I know this is not exactly Observable Framework specific, but is this a known issue/solvable? It happens using the built-in Markdown renderer in the current VS Code. Once you remove the template expression, syntax highlighting woks again: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
It's known (see e.g. #263), but currently not fixable. The gist is that a line starting with Here are a couple of workarounds:
Properly supporting interpolations would require implementing either a custom TextMate grammar (likely on top of VS Code's builtin one) or a language server (much more versatile, but much more complex - see e.g. Svelte). I'm not aware of any other Markdown flavors that support interpolation. |
Beta Was this translation helpful? Give feedback.
-
|
Unfortunately the above workarounds won't help with interpolations that span multiple lines. In those cases the workaround is a little more awkward: a <div class="card grid grid-cols-1">
${/*$<script>*/resize((width) =>
Plot.plot({ |
Beta Was this translation helpful? Give feedback.


It's known (see e.g. #263), but currently not fixable. The gist is that a line starting with
$is detected as the start of a LaTeX expression which has to be closed by a second$.Here are a couple of workarounds:
${foo}<div>${foo}</div>${foo}<!--$-->${foo /*$*/}$prefixed variable name:${$foo}const $ = ...somewhere, then use it in a comma expression:${$, foo}Properly supporting interpolations would require implementing either a custom TextMate grammar (likely on top of VS Cod…