From 8db0a46e31133cab10f299f3b204703f2ab142f4 Mon Sep 17 00:00:00 2001 From: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> Date: Sun, 20 Oct 2019 13:40:00 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20Add=C2=A0EJS=C2=A0support=20to=C2=A0Mar?= =?UTF-8?q?kdown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 13 +++++++- syntaxes/markdown-ejs.tmLanguage.json | 44 +++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 syntaxes/markdown-ejs.tmLanguage.json diff --git a/package.json b/package.json index 6c386b8..15e9c52 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,17 @@ "meta.embedded.block.ejs": "ejs", "meta.embedded.block.javascript": "source.js" } + }, + { + "scopeName": "text.html.markdown.ejs", + "path": "./syntaxes/markdown-ejs.tmLanguage.json", + "injectTo": [ + "text.html.markdown" + ], + "embeddedLanguages": { + "meta.embedded.block.ejs": "ejs", + "meta.embedded.block.javascript": "source.js" + } } ], "configurationDefaults": { @@ -54,4 +65,4 @@ "publisherId": "8a82c29a-f974-4692-be63-35a118c52919", "publisherDisplayName": "DigitalBrainstem" } -} \ No newline at end of file +} diff --git a/syntaxes/markdown-ejs.tmLanguage.json b/syntaxes/markdown-ejs.tmLanguage.json new file mode 100644 index 0000000..87acf2a --- /dev/null +++ b/syntaxes/markdown-ejs.tmLanguage.json @@ -0,0 +1,44 @@ +{ + "scopeName": "text.html.markdown.ejs", + "injectionSelector": "L:(text.html.markdown markup.fenced_code.block.markdown)", + "patterns": [ + { + "include": "#fenced_code_block_ejs" + } + ], + "repository": { + "fenced_code_block_ejs": { + "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(ejs)(\\s+[^`~]*)?$)", + "name": "markup.fenced_code.block.markdown", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.markdown" + }, + "5": { + "name": "fenced_code.block.language" + }, + "6": { + "name": "fenced_code.block.language.attributes" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.markdown" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.ejs", + "patterns": [ + { + "include": "text.html.ejs" + } + ] + } + ] + } + } +}