yzhang-gh / vscode-markdown

Markdown All in One
https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
MIT License
2.88k stars 324 forks source link

Syntax decorations for code span add unwanted boxes to GitLab inline math #713

Open Momo-Coco opened 4 years ago

Momo-Coco commented 4 years ago

What is the problem?

The boxes enclosing gitlab-style inline math formulae in editor include backticks when it should not.

How can I reproduce it?

Type a gitlab-style inline formula, e.g. $`i=1`$. The box encloses `i=1`, when it should enclose only i=1

Is there any error message in the console?

yzhang-gh commented 4 years ago

This extension only supports basic math functionality. Please turn to Markdown+Math for more features (see README).

yzhang-gh commented 4 years ago

Oh, you are talking about the code span decoration. It is not designed for GitLab inline math...

You can disable it with option syntax.decorations.

Momo-Coco commented 4 years ago

It seems that if i disable syntax,decorations, math formulae no longer get displayed in the previewer.

yzhang-gh commented 4 years ago

Just checked and nothing wrong here (and shouldn't). Please reload VSCode or check whether there other conflicting extensions.

Momo-Coco commented 4 years ago

yes, it looks like it's fighting with Markdown+Math. However, is it possible to fix the syntax decorations to recognize the default KaTeX/GitLab format? I think it shouldn't be that hard.

yzhang-gh commented 4 years ago

If anyone is interested, here is the code pointer

https://github.com/yzhang-gh/vscode-markdown/blob/501bb2315e176e7bd78cf1015f7c855e6f8a0ae3/src/syntaxDecorations.ts#L39-L42