diff --git a/extensions/markdown-math/syntaxes/md-math-inline.tmLanguage.json b/extensions/markdown-math/syntaxes/md-math-inline.tmLanguage.json index bbffacfd328..a5e38e6fd94 100644 --- a/extensions/markdown-math/syntaxes/md-math-inline.tmLanguage.json +++ b/extensions/markdown-math/syntaxes/md-math-inline.tmLanguage.json @@ -3,16 +3,39 @@ "injectionSelector": "L:meta.paragraph.markdown - (comment, string, markup.math.inline.markdown, markup.fenced_code.block.markdown)", "patterns": [ { - "include": "#math_inline" + "include": "#math_inline_double" + }, + { + "include": "#math_inline_single" }, { "include": "#math_inline_block" } ], "repository": { - "math_inline": { + "math_inline_single": { "name": "markup.math.inline.markdown", - "match": "(?<=\\s|^)(\\${1,2})(.+?)(\\${1,2})(?=\\s|$)", + "match": "(?<=\\s|\\W|^)(? + +Should be highlighted $\frac{1}{2}$. + +Should not be highlighted $\frac{1}{2}$text + +Should not be highlighted $\frac{1}{2}$10 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 d443dd49c8c..f49f0313a87 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 @@ -6279,5 +6279,192 @@ "light_vs": "markup.bold: #000080", "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": "Should be highlighted ", + "t": "text.html.markdown meta.paragraph.markdown", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #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" + } + }, + { + "c": "\\", + "t": "text.html.markdown meta.paragraph.markdown markup.math.inline.markdown meta.embedded.math.markdown meta.function.math.tex storage.type.function.math.tex punctuation.definition.function.math.tex", + "r": { + "dark_plus": "storage.type: #569CD6", + "light_plus": "storage.type: #0000FF", + "dark_vs": "storage.type: #569CD6", + "light_vs": "storage.type: #0000FF", + "hc_black": "storage.type: #569CD6" + } + }, + { + "c": "frac", + "t": "text.html.markdown meta.paragraph.markdown markup.math.inline.markdown meta.embedded.math.markdown meta.function.math.tex storage.type.function.math.tex entity.name.function.math.tex", + "r": { + "dark_plus": "entity.name.function: #DCDCAA", + "light_plus": "entity.name.function: #795E26", + "dark_vs": "storage.type: #569CD6", + "light_vs": "storage.type: #0000FF", + "hc_black": "entity.name.function: #DCDCAA" + } + }, + { + "c": "{", + "t": "text.html.markdown meta.paragraph.markdown markup.math.inline.markdown meta.embedded.math.markdown meta.function.math.tex punctuation.definition.arguments.begin.math.tex", + "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": "1", + "t": "text.html.markdown meta.paragraph.markdown markup.math.inline.markdown meta.embedded.math.markdown meta.function.math.tex constant.numeric.math.tex", + "r": { + "dark_plus": "constant.numeric: #B5CEA8", + "light_plus": "constant.numeric: #098658", + "dark_vs": "constant.numeric: #B5CEA8", + "light_vs": "constant.numeric: #098658", + "hc_black": "constant.numeric: #B5CEA8" + } + }, + { + "c": "}", + "t": "text.html.markdown meta.paragraph.markdown markup.math.inline.markdown meta.embedded.math.markdown meta.function.math.tex punctuation.definition.arguments.end.math.tex", + "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 meta.embedded.math.markdown punctuation.math.begin.bracket.curly", + "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": "2", + "t": "text.html.markdown meta.paragraph.markdown markup.math.inline.markdown meta.embedded.math.markdown constant.numeric.math.tex", + "r": { + "dark_plus": "constant.numeric: #B5CEA8", + "light_plus": "constant.numeric: #098658", + "dark_vs": "constant.numeric: #B5CEA8", + "light_vs": "constant.numeric: #098658", + "hc_black": "constant.numeric: #B5CEA8" + } + }, + { + "c": "}", + "t": "text.html.markdown meta.paragraph.markdown markup.math.inline.markdown meta.embedded.math.markdown punctuation.math.end.bracket.curly", + "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" + } + }, + { + "c": ".", + "t": "text.html.markdown meta.paragraph.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 $\\frac{1}{2}$text", + "t": "text.html.markdown meta.paragraph.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 $\\frac{1}{2}$10", + "t": "text.html.markdown meta.paragraph.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