From 3eacbae04002c3ce01c7e7704184bfc48ecb603b Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 7 Nov 2016 16:03:49 -0800 Subject: [PATCH] Highlight Markdown Image Starting ! Punctuator (#12841) * Highlight Markdown Image Starting ! Puctuator Issue #12835 Adds highlighting for the `!` that defines a markdown image link. This is colored the same as the `[` after it. Closes #12835 * Fixed highlight test --- extensions/markdown/syntaxes/markdown.tmLanguage | 5 ++--- .../markdown/test/colorize-results/test_md.json | 13 +------------ 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/extensions/markdown/syntaxes/markdown.tmLanguage b/extensions/markdown/syntaxes/markdown.tmLanguage index 367e58e1990..0175e010433 100644 --- a/extensions/markdown/syntaxes/markdown.tmLanguage +++ b/extensions/markdown/syntaxes/markdown.tmLanguage @@ -1434,8 +1434,7 @@ match (?x: - \! # Images start with ! - (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) + (\!\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) # Match the link text. ([ ])? # Space not allowed (\() # Opening paren for url @@ -1487,7 +1486,7 @@ match - \!(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(.*?)(\]) + (\!\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(.*?)(\]) name meta.image.reference.markdown diff --git a/extensions/markdown/test/colorize-results/test_md.json b/extensions/markdown/test/colorize-results/test_md.json index 29ca78c3823..1658fc53aab 100644 --- a/extensions/markdown/test/colorize-results/test_md.json +++ b/extensions/markdown/test/colorize-results/test_md.json @@ -2123,18 +2123,7 @@ } }, { - "c": "!", - "t": "image.inline.markdown.meta.paragraph", - "r": { - "dark_plus": ".vs-dark .token rgb(212, 212, 212)", - "light_plus": ".vs .token rgb(0, 0, 0)", - "dark_vs": ".vs-dark .token rgb(212, 212, 212)", - "light_vs": ".vs .token rgb(0, 0, 0)", - "hc_black": ".hc-black .token rgb(255, 255, 255)" - } - }, - { - "c": "[", + "c": "![", "t": "begin.definition.image.inline.markdown.meta.paragraph.punctuation.string", "r": { "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.string rgb(206, 145, 120)",