diff --git a/package.json b/package.json index 895100e..700af36 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,13 @@ "injectTo": [ "text.html.markdown" ] + }, + { + "scopeName": "markdown.feature.codeblock", + "path": "./syntaxes/codeblock.json", + "injectTo": [ + "text.html.markdown" + ] } ], "snippets": [ diff --git a/syntaxes/codeblock.json b/syntaxes/codeblock.json new file mode 100644 index 0000000..f5298c9 --- /dev/null +++ b/syntaxes/codeblock.json @@ -0,0 +1,45 @@ +{ + "fileTypes": [], + "injectionSelector": "L:text.html.markdown", + "patterns": [ + { + "include": "#feature-code-block" + } + ], + "repository": { + "feature-code-block": { + "begin": "(^|\\G)(\\s*)(\\`{3,}|~{3,})\\s*(?i:(feature)(\\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.feature", + "patterns": [ + { + "include": "text.gherkin.feature" + } + ] + } + ] + } + }, + "scopeName": "text.gherkin.feature" +}