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

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

Open
Momo-Coco opened this issue Jun 2, 2020 · 6 comments
Labels
Area: Editor theming Decorations and highlighting in editor. Area: Math Help wanted Looking for help.

Comments

@Momo-Coco
Copy link

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
Copy link
Owner

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

@yzhang-gh yzhang-gh added Area: Math Markdown dialect Neither GFM, nor extensions currently accepted. labels Jun 3, 2020
@yzhang-gh
Copy link
Owner

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.

@yzhang-gh yzhang-gh removed Area: Math Markdown dialect Neither GFM, nor extensions currently accepted. labels Jun 3, 2020
@Momo-Coco
Copy link
Author

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

@yzhang-gh
Copy link
Owner

yzhang-gh commented Jun 4, 2020

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

@Momo-Coco
Copy link
Author

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
Copy link
Owner

If anyone is interested, here is the code pointer

let regexDecorTypeMapping = {
"(~~.+?~~)": ["strikethrough"],
"(?<!`)(`+)(?!`)(.*?)(?<!`)(\\1)(?!`)": ["codeSpan"]
};

@yzhang-gh yzhang-gh added the Help wanted Looking for help. label Jun 4, 2020
@yzhang-gh yzhang-gh added the Area: Editor theming Decorations and highlighting in editor. label Jul 23, 2020
@Lemmingh Lemmingh changed the title Boxes for inline math formule include backticks in GitLab mode Syntax decorations for code span add unwanted boxes to GitLab inline math Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Editor theming Decorations and highlighting in editor. Area: Math Help wanted Looking for help.
Projects
None yet
Development

No branches or pull requests

3 participants