From 0dba492e01c5ca1afff8a9de94ba6d8d29ea019f Mon Sep 17 00:00:00 2001 From: Khaled Date: Wed, 5 Jan 2022 12:13:29 -0800 Subject: [PATCH] Corrected the regex to detect espaced percent symbol (#139437) --- .../syntaxes/md-math.tmLanguage.json | 2 +- .../test/colorize-fixtures/md-math.md | 4 ++ .../test/colorize-results/md-math_md.json | 66 +++++++++++++++++++ 3 files changed, 71 insertions(+), 1 deletion(-) diff --git a/extensions/markdown-math/syntaxes/md-math.tmLanguage.json b/extensions/markdown-math/syntaxes/md-math.tmLanguage.json index b7c1b6fc4df..d3146023ecc 100644 --- a/extensions/markdown-math/syntaxes/md-math.tmLanguage.json +++ b/extensions/markdown-math/syntaxes/md-math.tmLanguage.json @@ -14,7 +14,7 @@ "patterns": [ { "name": "comment.line.math.tex", - "match": "(%)(.+)$", + "match": "((? + +$$ \% Should not be highlighted $$ diff --git a/extensions/vscode-colorize-tests/test/colorize-results/md-math_md.json b/extensions/vscode-colorize-tests/test/colorize-results/md-math_md.json index 51e8f336d91..e9183132567 100644 --- a/extensions/vscode-colorize-tests/test/colorize-results/md-math_md.json +++ b/extensions/vscode-colorize-tests/test/colorize-results/md-math_md.json @@ -6532,5 +6532,71 @@ "light_vs": "default: #000000", "hc_black": "default: #FFFFFF" } + }, + { + "c": "", + "t": "text.html.markdown comment.block.html punctuation.definition.comment.html", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668" + } + }, + { + "c": "$$", + "t": "text.html.markdown meta.paragraph.markdown markup.math.inline.markdown punctuation.definition.math.begin.markdown", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " \\% Should not be highlighted ", + "t": "text.html.markdown meta.paragraph.markdown markup.math.inline.markdown meta.embedded.math.markdown", + "r": { + "dark_plus": "meta.embedded: #D4D4D4", + "light_plus": "meta.embedded: #000000", + "dark_vs": "meta.embedded: #D4D4D4", + "light_vs": "meta.embedded: #000000", + "hc_black": "meta.embedded: #FFFFFF" + } + }, + { + "c": "$$", + "t": "text.html.markdown meta.paragraph.markdown markup.math.inline.markdown punctuation.definition.math.begin.markdown", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } } ] \ No newline at end of file