Microsoft/vscode

Inside of multiline math expressions in markdown files is not recognized as math/latex context.

Open

#202,450 opened on Jan 14, 2024

View on GitHub
 (4 comments) (1 reaction) (2 assignees)TypeScript (10,221 forks)batch import
buggrammarhelp wantedmarkdown-ext

Repository metrics

Stars
 (74,848 stars)
PR merge metrics
 (Avg merge 11h 43m) (1,000 merged PRs in 30d)

Description

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.85.1
  • OS Version: Windows 11

In markdown file, multiline math expressions like the following are valid and supported by the official markdown preview feature. But the inside of the dollar signs is not recognized as math/latex context unless the beginning dollar sign is at the start of the line. I checked the context by "Inspect Editor Tokens and Scopes".

aaa $\begin{pmatrix}
1 & 2 \\
3 & 4 \\
\end{pmatrix}$ bbb

I have a lot of latex snippets for writing math expressions in markdown, but they are not suggested in such expressions for this issue.

btw, I have a setting "markdown.preview.breaks": true. When this is true, I think the only way to write an inline multiline math expression is like this.

Contributor guide