From 45fbd00dd5027c58b61c13a2e6eb84f61635fde0 Mon Sep 17 00:00:00 2001 From: Eklavya Mirani Date: Sat, 27 Aug 2016 13:55:51 +0530 Subject: [PATCH 1/3] Moved TM Markdown seperator rule below the Paragraph rule to fix the alt heading 2 syntax highlighting. --- extensions/markdown/syntaxes/markdown.tmLanguage | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/extensions/markdown/syntaxes/markdown.tmLanguage b/extensions/markdown/syntaxes/markdown.tmLanguage index 9a41ee6464e..955baa07133 100644 --- a/extensions/markdown/syntaxes/markdown.tmLanguage +++ b/extensions/markdown/syntaxes/markdown.tmLanguage @@ -26,10 +26,6 @@ patterns - - include - #separator - include #heading @@ -206,6 +202,11 @@ include #paragraph + + include + #separator + + repository From 9aff1d0f749e5ed14f26257257f01a8c88cc5b28 Mon Sep 17 00:00:00 2001 From: Eklavya Mirani Date: Sun, 28 Aug 2016 16:31:02 +0530 Subject: [PATCH 2/3] Added the --- seperator to the paragraph rule to allow heading-setext.2 rule to be recognized --- .../markdown/syntaxes/markdown.tmLanguage | 17 ++++++----------- .../markdown/test/colorize-fixtures/test.md | 6 ++++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/extensions/markdown/syntaxes/markdown.tmLanguage b/extensions/markdown/syntaxes/markdown.tmLanguage index 955baa07133..a40dffd3baf 100644 --- a/extensions/markdown/syntaxes/markdown.tmLanguage +++ b/extensions/markdown/syntaxes/markdown.tmLanguage @@ -26,6 +26,10 @@ patterns + + include + #separator + include #heading @@ -202,11 +206,6 @@ include #paragraph - - include - #separator - - repository @@ -413,10 +412,6 @@ include text.html.basic - - include - #heading-setext - while (^|\G)(?!\s*$|#|[ ]{0,3}([-*_][ ]{2,}){3,}[ \t]*$\n?|>|[ ]{0,3}[*+-]|[ ]{0,3}[0-9]+\.) @@ -508,7 +503,7 @@ - (^|\G)(?!\s*$|#|[ ]{0,3}((([-*_][ ]{0,2}\2){2,}[ \t]*$\n?)|([*+-]([ ]{1,3}|\t)))|\s*\[.+?\]:|>) + (^|\G)(?!\s*$|#|[ ]{0,3}((([*_][ ]{0,2}\2){2,}[ \t]*$\n?)|([*+-]([ ]{1,3}|\t)))|\s*\[.+?\]:|>) raw_block @@ -1114,7 +1109,7 @@ separator match - (^|\G)[ ]{0,3}([-*_])([ ]{0,2}\2){2,}[ \t]*$\n? + (^|\G)[ ]{0,3}([*-_])([ ]{0,2}\2){2,}[ \t]*$\n? name meta.separator.markdown diff --git a/extensions/markdown/test/colorize-fixtures/test.md b/extensions/markdown/test/colorize-fixtures/test.md index ee7b78e670b..dd4eb788b46 100644 --- a/extensions/markdown/test/colorize-fixtures/test.md +++ b/extensions/markdown/test/colorize-fixtures/test.md @@ -4,6 +4,12 @@ ## Markdown plus h2 with a custom ID ## {#id-goes-here} [Link back to H2](#id-goes-here) +### Alternate heading styles: +Alternate Header 1 +========================== +Alternate Header 2 +-------------------------- +
From 2e886c0708483c27876294fba24d50e216dc81af Mon Sep 17 00:00:00 2001 From: Eklavya Mirani Date: Sun, 28 Aug 2016 23:20:58 +0530 Subject: [PATCH 3/3] fixed broken markdown tests. --- .../markdown/syntaxes/markdown.tmLanguage | 4 + .../markdown/test/colorize-fixtures/test.md | 4 +- .../test/colorize-results/test_md.json | 77 +++++++++++++++++++ 3 files changed, 83 insertions(+), 2 deletions(-) diff --git a/extensions/markdown/syntaxes/markdown.tmLanguage b/extensions/markdown/syntaxes/markdown.tmLanguage index a40dffd3baf..e9bbc06c1d3 100644 --- a/extensions/markdown/syntaxes/markdown.tmLanguage +++ b/extensions/markdown/syntaxes/markdown.tmLanguage @@ -412,6 +412,10 @@ include text.html.basic + + include + #heading-setext + while (^|\G)(?!\s*$|#|[ ]{0,3}([-*_][ ]{2,}){3,}[ \t]*$\n?|>|[ ]{0,3}[*+-]|[ ]{0,3}[0-9]+\.) diff --git a/extensions/markdown/test/colorize-fixtures/test.md b/extensions/markdown/test/colorize-fixtures/test.md index dd4eb788b46..4458036582a 100644 --- a/extensions/markdown/test/colorize-fixtures/test.md +++ b/extensions/markdown/test/colorize-fixtures/test.md @@ -6,9 +6,9 @@ ### Alternate heading styles: Alternate Header 1 -========================== +================== Alternate Header 2 --------------------------- +------------------
diff --git a/extensions/markdown/test/colorize-results/test_md.json b/extensions/markdown/test/colorize-results/test_md.json index 4f40023d335..c402182aa59 100644 --- a/extensions/markdown/test/colorize-results/test_md.json +++ b/extensions/markdown/test/colorize-results/test_md.json @@ -241,6 +241,83 @@ "hc_black": ".hc-black .token rgb(255, 255, 255)" } }, + { + "c": "###", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.definition.heading.markdown.markup.punctuation", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": " ", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.heading.markdown.markup", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": "Alternate heading styles:", + "t": "${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.entity.heading.markdown.markup.name.section", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": "Alternate Header 1", + "t": "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": "==================", + "t": "1.heading.markdown.markup.meta.paragraph.setext", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, + { + "c": "Alternate Header 2", + "t": "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": "------------------", + "t": "2.heading.markdown.markup.meta.paragraph.setext", + "r": { + "dark_plus": ".vs-dark.vscode-theme-defaults-themes-dark_plus-json .token.markup.heading rgb(86, 156, 214)", + "light_plus": ".vs.vscode-theme-defaults-themes-light_plus-json .token.markup.heading rgb(128, 0, 0)", + "dark_vs": ".vs-dark.vscode-theme-defaults-themes-dark_vs-json .token.markup.heading rgb(86, 156, 214)", + "light_vs": ".vs.vscode-theme-defaults-themes-light_vs-json .token.markup.heading rgb(128, 0, 0)", + "hc_black": ".hc-black.vscode-theme-defaults-themes-hc_black-json .token.markup.heading rgb(103, 150, 230)" + } + }, { "c": "