From 521221656606592d5cc99bb76adfc2e46f1f8f0f Mon Sep 17 00:00:00 2001 From: jonschlinkert Date: Sun, 7 Oct 2018 00:15:17 -0400 Subject: [PATCH] refactor --- .gitignore | 30 +- Syntaxes/Markdown Extended.JSON-tmLanguage | 1724 ------------ Syntaxes/Markdown Extended.YAML-tmLanguage | 872 ------ Syntaxes/Markdown Extended.sublime-syntax | 1360 +++++++-- Syntaxes/Markdown Extended.tmLanguage | 2887 -------------------- build/data/context.js | 179 ++ build/output/fences.yaml | 1394 ++++++++++ build/output/syntax.yaml | 2158 +++++++++++++++ build/render.js | 78 + build/templates/fences.hbs | 15 + build/templates/syntax.hbs | 793 ++++++ 11 files changed, 5736 insertions(+), 5754 deletions(-) delete mode 100644 Syntaxes/Markdown Extended.JSON-tmLanguage delete mode 100644 Syntaxes/Markdown Extended.YAML-tmLanguage delete mode 100644 Syntaxes/Markdown Extended.tmLanguage create mode 100644 build/data/context.js create mode 100644 build/output/fences.yaml create mode 100644 build/output/syntax.yaml create mode 100644 build/render.js create mode 100644 build/templates/fences.hbs create mode 100644 build/templates/syntax.hbs diff --git a/.gitignore b/.gitignore index 82b6afb..f969a2c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,30 @@ -*.cache +# always ignore files +*.DS_Store +.idea +.vscode +*.sublime-* + +# test related, or directories generated by tests +test/actual +actual +coverage +.nyc* + +# npm +node_modules +npm-debug.log + +# yarn +yarn.lock +yarn-error.log + +# misc +_gh_pages +_draft +_drafts +bower_components +vendor +temp tmp +TODO.md +package-lock.json \ No newline at end of file diff --git a/Syntaxes/Markdown Extended.JSON-tmLanguage b/Syntaxes/Markdown Extended.JSON-tmLanguage deleted file mode 100644 index c7f2e67..0000000 --- a/Syntaxes/Markdown Extended.JSON-tmLanguage +++ /dev/null @@ -1,1724 +0,0 @@ -{ - "name": "Markdown Extended", - "foldingStartMarker": "(?x)\n(<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\\b.*?>\n|)\n|\\{\\s*($|\\?>\\s*$|//|/\\*(.*\\*/\\s*$|(?!.*?\\*/)))\n)", - "scopeName": "text.html.markdown", - "foldingStopMarker": "(?x)\n(\n|^\\s*-->\n|(^|\\s)\\}\n)", - "uuid": "dd477cf1-34c4-49d2-ba09-f8445676ccd4", - "repository": { - "bold": { - "name": "markup.bold.markdown", - "end": "(?<=\\S)(\\1)", - "begin": "(?x)\n(\\*\\*|__)(?=\\S) # Open\n(?=\n (\n <[^>]*+> # HTML tags\n | (?`+)([^`]|(?!(?(?!`))`)*+\\k\n # Raw\n | \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+ # Escapes\n | \\[\n (\n (? # Named group\n [^\\[\\]\\\\] # Match most chars\n | \\\\. # Escaped chars\n | \\[ \\g*+ \\] # Nested brackets\n )*+\n \\]\n (\n ( # Reference Link\n [ ]? # Optional space\n \\[[^\\]]*+\\] # Ref name\n )\n | ( # Inline Link\n \\( # Opening paren\n [ \\t]*+ # Optional whtiespace\n ? # URL\n [ \\t]*+ # Optional whtiespace\n ( # Optional Title\n (?['\"])\n (.*?)\n \\k<title>\n )?\n \\)\n )\n )\n )\n | (?!(?<=\\S)\\1). # Everything besides\n # style closer\n )++\n (?<=\\S)\\1 # Close\n)", - "patterns": [ - { - "end": "(?<=>)", - "patterns": [ - { - "include": "text.html.handlebars" - } - ], - "applyEndPatternLast": 1, - "begin": "(?=<[^>]*?>)" - }, - { - "include": "#escape" - }, - { - "include": "#ampersand" - }, - { - "include": "#bracket" - }, - { - "include": "#raw" - }, - { - "include": "#italic" - }, - { - "include": "#strike" - }, - { - "include": "#image-inline" - }, - { - "include": "#link-inline" - }, - { - "include": "#link-inet" - }, - { - "include": "#link-email" - }, - { - "include": "#image-ref" - }, - { - "include": "#link-ref-literal" - }, - { - "include": "#link-ref" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.bold.markdown" - } - } - }, - "link-inet": { - "name": "meta.link.inet.markdown", - "match": "(<)((?:https?|ftp)://.*?)(>)", - "captures": { - "1": { - "name": "punctuation.definition.link.markdown" - }, - "2": { - "name": "markup.underline.link.markdown" - }, - "3": { - "name": "punctuation.definition.link.markdown" - } - } - }, - "link-inline": { - "name": "meta.link.inline.markdown", - "match": "(?x:\n (\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])\n # Match the link text.\n ([ ])? # Space not allowed\n (\\() # Opening paren for url\n (<?)(.*?)(>?) # The url\n [ \\t]* # Optional whitespace\n (?:\n ((\\().+?(\\))) # Match title in parens\u2026\n | ((\").+?(\")) # or in quotes.\n )? # Title is optional\n \\s* # Optional whitespace\n (\\))\n )", - "captures": { - "4": { - "name": "punctuation.definition.string.end.markdown" - }, - "5": { - "name": "invalid.illegal.whitespace.markdown" - }, - "6": { - "name": "punctuation.definition.metadata.markdown" - }, - "7": { - "name": "punctuation.definition.link.markdown" - }, - "10": { - "name": "string.other.link.description.title.markdown" - }, - "1": { - "name": "punctuation.definition.string.begin.markdown" - }, - "2": { - "name": "string.other.link.title.markdown" - }, - "12": { - "name": "punctuation.definition.string.end.markdown" - }, - "13": { - "name": "string.other.link.description.title.markdown" - }, - "8": { - "name": "markup.underline.link.markdown" - }, - "9": { - "name": "punctuation.definition.link.markdown" - }, - "16": { - "name": "punctuation.definition.metadata.markdown" - }, - "15": { - "name": "punctuation.definition.string.end.markdown" - }, - "14": { - "name": "punctuation.definition.string.begin.markdown" - }, - "11": { - "name": "punctuation.definition.string.begin.markdown" - } - } - }, - "image-inline": { - "name": "meta.image.inline.markdown", - "match": "(?x:\n \\! # Images start with !\n (\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])\n # Match the link text.\n ([ ])? # Space not allowed\n (\\() # Opening paren for url\n (<?)(\\S+?)(>?) # The url\n [ \\t]* # Optional whitespace\n (?:\n ((\\().+?(\\))) # Match title in parens\u2026\n | ((\").+?(\")) # or in quotes.\n )? # Title is optional\n \\s* # Optional whitespace\n (\\))\n )", - "captures": { - "4": { - "name": "punctuation.definition.string.end.markdown" - }, - "5": { - "name": "invalid.illegal.whitespace.markdown" - }, - "6": { - "name": "punctuation.definition.metadata.markdown" - }, - "7": { - "name": "punctuation.definition.link.markdown" - }, - "10": { - "name": "string.other.link.description.title.markdown" - }, - "1": { - "name": "punctuation.definition.string.begin.markdown" - }, - "2": { - "name": "string.other.link.description.markdown" - }, - "12": { - "name": "punctuation.definition.string.markdown" - }, - "13": { - "name": "string.other.link.description.title.markdown" - }, - "8": { - "name": "markup.underline.link.image.markdown" - }, - "9": { - "name": "punctuation.definition.link.markdown" - }, - "16": { - "name": "punctuation.definition.metadata.markdown" - }, - "15": { - "name": "punctuation.definition.string.markdown" - }, - "14": { - "name": "punctuation.definition.string.markdown" - }, - "11": { - "name": "punctuation.definition.string.markdown" - } - } - }, - "ampersand": { - "name": "meta.other.valid-ampersand.markdown", - "match": "&(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)", - "comment": "\n Markdown will convert this for us. We match it so that the\n HTML grammar will not mark it up as invalid.\n " - }, - "escape": { - "name": "constant.character.escape.markdown", - "match": "\\\\[-`*_#+.!(){}\\[\\]\\\\>]" - }, - "italic": { - "name": "markup.italic.markdown", - "end": "(?<=\\S)(\\1)((?!\\1)|(?=\\1\\1))", - "begin": "(?x)\n(\\*|_)(?=\\S) # Open\n(?=\n (\n <[^>]*+> # HTML tags\n | (?<raw>`+)([^`]|(?!(?<!`)\\k<raw>(?!`))`)*+\\k<raw>\n # Raw\n | \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+ # Escapes\n | \\[\n (\n (?<square> # Named group\n [^\\[\\]\\\\] # Match most chars\n | \\\\. # Escaped chars\n | \\[ \\g<square>*+ \\] # Nested brackets\n )*+\n \\]\n (\n ( # Reference Link\n [ ]? # Optional space\n \\[[^\\]]*+\\] # Ref name\n )\n | ( # Inline Link\n \\( # Opening paren\n [ \\t]*+ # Optional whtiespace\n <?(.*?)>? # URL\n [ \\t]*+ # Optional whtiespace\n ( # Optional Title\n (?<title>['\"])\n (.*?)\n \\k<title>\n )?\n \\)\n )\n )\n )\n | \\1\\1 # Must be bold closer\n | (?!(?<=\\S)\\1). # Everything besides\n # style closer\n )++\n (?<=\\S)\\1 # Close\n)", - "patterns": [ - { - "end": "(?<=>)", - "patterns": [ - { - "include": "text.html.handlebars" - } - ], - "applyEndPatternLast": 1, - "begin": "(?=<[^>]*?>)" - }, - { - "include": "#escape" - }, - { - "include": "#ampersand" - }, - { - "include": "#bracket" - }, - { - "include": "#raw" - }, - { - "include": "#bold" - }, - { - "include": "#strike" - }, - { - "include": "#image-inline" - }, - { - "include": "#link-inline" - }, - { - "include": "#link-inet" - }, - { - "include": "#link-email" - }, - { - "include": "#image-ref" - }, - { - "include": "#link-ref-literal" - }, - { - "include": "#link-ref" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.italic.markdown" - } - } - }, - "strike": { - "name": "markup.strike.markdown", - "end": "(?<=\\S)(\\1)((?!\\1)|(?=\\1\\1))", - "begin": "(?x)\n(~~)(?=\\S) # Open\n(?=\n (\n <[^>]*+> # HTML tags\n | (?<raw>`+)([^`]|(?!(?<!`)\\k<raw>(?!`))`)*+\\k<raw>\n # Raw\n | \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+ # Escapes\n | \\[\n (\n (?<square> # Named group\n [^\\[\\]\\\\] # Match most chars\n | \\\\. # Escaped chars\n | \\[ \\g<square>*+ \\] # Nested brackets\n )*+\n \\]\n (\n ( # Reference Link\n [ ]? # Optional space\n \\[[^\\]]*+\\] # Ref name\n )\n | ( # Inline Link\n \\( # Opening paren\n [ \\t]*+ # Optional whtiespace\n <?(.*?)>? # URL\n [ \\t]*+ # Optional whtiespace\n ( # Optional Title\n (?<title>['\"])\n (.*?)\n \\k<title>\n )?\n \\)\n )\n )\n )\n | \\1\\1 # Must be bold closer\n | (?!(?<=\\S)\\1). # Everything besides\n # style closer\n )++\n (?<=\\S)\\1 # Close\n)", - "patterns": [ - { - "end": "(?<=>)", - "patterns": [ - { - "include": "text.html.handlebars" - } - ], - "applyEndPatternLast": 1, - "begin": "(?=<[^>]*?>)" - }, - { - "include": "#escape" - }, - { - "include": "#ampersand" - }, - { - "include": "#bracket" - }, - { - "include": "#raw" - }, - { - "include": "#bold" - }, - { - "include": "#italic" - }, - { - "include": "#image-inline" - }, - { - "include": "#link-inline" - }, - { - "include": "#link-inet" - }, - { - "include": "#link-email" - }, - { - "include": "#image-ref" - }, - { - "include": "#link-ref-literal" - }, - { - "include": "#link-ref" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.strike.markdown" - } - } - }, - "line-break": { - "name": "meta.dummy.line-break", - "match": " {2,}$" - }, - "raw": { - "name": "markup.raw.inline.markdown", - "match": "(`+)([^`]|(?!(?<!`)\\1(?!`))`)*+(\\1)", - "captures": { - "1": { - "name": "punctuation.definition.raw.markdown" - }, - "3": { - "name": "punctuation.definition.raw.markdown" - } - } - }, - "inline": { - "patterns": [ - { - "include": "#escape" - }, - { - "include": "#ampersand" - }, - { - "include": "#bracket" - }, - { - "include": "#raw" - }, - { - "include": "#bold" - }, - { - "include": "#italic" - }, - { - "include": "#strike" - }, - { - "include": "#line-break" - }, - { - "include": "#image-inline" - }, - { - "include": "#link-inline" - }, - { - "include": "#link-inet" - }, - { - "include": "#link-email" - }, - { - "include": "#image-ref" - }, - { - "include": "#link-ref-literal" - }, - { - "include": "#link-ref" - } - ] - }, - "block_raw": { - "name": "markup.raw.block.markdown", - "match": "\\G([ ]{4}|\\t).*$\\n?" - }, - "separator": { - "name": "meta.separator.markdown", - "match": "\\G[ ]{,3}([-*_])([ ]{,2}\\1){2,}[ \\t]*$\\n?" - }, - "heading": { - "patterns": [ - // H1 - { - "name": "markup.heading.1.markdown", - "end": "\\s*(#*)$\\n?", - "begin": "\\G(#{1})(?!#)\\s*(?=\\S)", - "patterns": [ - { - "include": "#inline" - } - ], - "contentName": "markup.heading.1.markdown", // Default: entity.name.section.markdown - "captures": { - "1": { - "name": "punctuation.definition.heading.markdown" - } - } - }, - // H2 - { - "name": "markup.heading.2.markdown", - "end": "\\s*(#*)$\\n?", - "begin": "\\G(#{2})(?!#)\\s*(?=\\S)", - "patterns": [ - { - "include": "#inline" - } - ], - "contentName": "markup.heading.2.markdown", - "captures": { - "1": { - "name": "punctuation.definition.heading.markdown" - } - } - }, - // H3 - { - "name": "markup.heading.3.markdown", - "end": "\\s*(#*)$\\n?", - "begin": "\\G(#{3})(?!#)\\s*(?=\\S)", - "patterns": [ - { - "include": "#inline" - } - ], - "contentName": "markup.heading.3.markdown", - "captures": { - "1": { - "name": "punctuation.definition.heading.markdown" - } - } - }, - // H4 - { - "name": "markup.heading.4.markdown", - "end": "\\s*(#*)$\\n?", - "begin": "\\G(#{4})(?!#)\\s*(?=\\S)", - "patterns": [ - { - "include": "#inline" - } - ], - "contentName": "markup.heading.4.markdown", - "captures": { - "1": { - "name": "punctuation.definition.heading.markdown" - } - } - }, - // H5 - { - "name": "markup.heading.5.markdown", - "end": "\\s*(#*)$\\n?", - "begin": "\\G(#{5})(?!#)\\s*(?=\\S)", - "patterns": [ - { - "include": "#inline" - } - ], - "contentName": "markup.heading.5.markdown", - "captures": { - "1": { - "name": "punctuation.definition.heading.markdown" - } - } - }, - // H6 - { - "name": "markup.heading.6.markdown", - "end": "\\s*(#*)$\\n?", - "begin": "\\G(#{6})(?!#)\\s*(?=\\S)", - "patterns": [ - { - "include": "#inline" - } - ], - "contentName": "markup.heading.6.markdown", - "captures": { - "1": { - "name": "punctuation.definition.heading.markdown" - } - } - } - ] - }, - "image-ref": { - "name": "meta.image.reference.markdown", - "match": "\\!(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])[ ]?(\\[)(.*?)(\\])", - "captures": { - "4": { - "name": "punctuation.definition.string.begin.markdown" - }, - "5": { - "name": "punctuation.definition.constant.markdown" - }, - "6": { - "name": "constant.other.reference.link.markdown" - }, - "7": { - "name": "punctuation.definition.constant.markdown" - }, - "1": { - "name": "punctuation.definition.string.begin.markdown" - }, - "2": { - "name": "string.other.link.description.markdown" - } - } - }, - "link-email": { - "name": "meta.link.email.lt-gt.markdown", - "match": "(<)((?:mailto:)?[-.\\w]+@[-a-z0-9]+(\\.[-a-z0-9]+)*\\.[a-z]+)(>)", - "captures": { - "4": { - "name": "punctuation.definition.link.markdown" - }, - "1": { - "name": "punctuation.definition.link.markdown" - }, - "2": { - "name": "markup.underline.link.markdown" - } - } - }, - "list-paragraph": { - "patterns": [ - { - "name": "meta.paragraph.list.markdown", - "end": "^\\s*$", - "patterns": [ - { - "include": "#inline" - } - ], - "begin": "\\G\\s+(?=\\S)" - } - ] - }, - "link-ref": { - "name": "meta.link.reference.markdown", - "match": "(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])[ ]?(\\[)([^\\]]*+)(\\])", - "captures": { - "4": { - "name": "punctuation.definition.string.end.markdown" - }, - "5": { - "name": "punctuation.definition.constant.begin.markdown" - }, - "6": { - "name": "constant.other.reference.link.markdown" - }, - "7": { - "name": "punctuation.definition.constant.end.markdown" - }, - "1": { - "name": "punctuation.definition.string.begin.markdown" - }, - "2": { - "name": "string.other.link.title.markdown" - } - } - }, - "bracket": { - "name": "meta.other.valid-bracket.markdown", - "match": "<(?![a-z/?\\$!])", - "comment": "\n Markdown will convert this for us. We match it so that the\n HTML grammar will not mark it up as invalid.\n " - }, - "link-ref-literal": { - "name": "meta.link.reference.literal.markdown", - "match": "(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])[ ]?(\\[)(\\])", - "captures": { - "4": { - "name": "punctuation.definition.string.end.markdown" - }, - "5": { - "name": "punctuation.definition.constant.begin.markdown" - }, - "6": { - "name": "punctuation.definition.constant.end.markdown" - }, - "1": { - "name": "punctuation.definition.string.begin.markdown" - }, - "2": { - "name": "string.other.link.title.markdown" - } - } - }, - "block_quote": { - "name": "markup.quote.markdown", - "end": "(?x)^\n(?= \\s*$\n| [ ]{,3}(?<marker>[-*_])([ ]{,2}\\k<marker>){2,}[ \\t]*+$\n| [ ]{,3}>.\n)", - "patterns": [ - { - "end": "^", - "patterns": [ - { - "include": "#block_quote" - } - ], - "begin": "(?x)\\G\n(?= [ ]{,3}>.\n)" - }, - { - "end": "^", - "patterns": [ - { - "include": "#block_raw" - }, - { - "include": "#heading" - }, - { - "include": "#separator" - } - ], - "applyEndPatternLast": 1, - "begin": "(?x)\\G\n(?= ([ ]{4}|\\t)\n| [#]{1,6}\\s*+\n| [ ]{,3}(?<marker>[-*_])([ ]{,2}\\k<marker>){2,}[ \\t]*+$\n)" - }, - { - "end": "$|(?<=\\n)", - "patterns": [ - { - "include": "#inline" - } - ], - "begin": "(?x)\\G\n(?! $\n| [ ]{,3}>.\n| ([ ]{4}|\\t)\n| [#]{1,6}\\s*+\n| [ ]{,3}(?<marker>[-*_])([ ]{,2}\\k<marker>){2,}[ \\t]*+$\n)" - } - ], - "comment": "\n We terminate the block quote when seeing an empty line, a\n separator or a line with leading > characters. The latter is\n to \u201creset\u201d the quote level for quoted lines.\n ", - "begin": "\\G[ ]{,3}(>)(?!$)[ ]?", - "beginCaptures": { - "1": { - "name": "punctuation.definition.blockquote.markdown" - } - } - } - }, - "patterns": [ - { - "name": "markup.raw.yaml.front-matter", - "end": "^---\\s", - "patterns": [ - { - "include": "source.yaml" - } - ], - "begin": "(?<!\\s)---\\n$" - }, - { - "name": "markup.raw.coffee.front-matter", - "end": "^---\\s", - "patterns": [ - { - "include": "source.coffee" - } - ], - "begin": "(?<!\\s)---\\s*coffee\\n$" - }, - { - "name": "markup.raw.json.front-matter", - "end": "^---\\s", - "patterns": [ - { - "include": "source.json" - } - ], - "begin": "(?<!\\s)---\\s*json\\n$" - }, - { - "name": "meta.block-level.markdown", - "end": "(?x)^\n(?! [ ]{,3}>.\n| ([ ]{4}|\\t)\n| [#]{1,6}\\s*+\n| [ ]{,3}(?<marker>[-*_])([ ]{,2}\\k<marker>){2,}[ \\t]*+$\n)", - "patterns": [ - { - "include": "#block_quote" - }, - { - "include": "#block_raw" - }, - { - "include": "#heading" - }, - { - "include": "#separator" - } - ], - "comment": "\n We could also use an empty end match and set\n applyEndPatternLast, but then we must be sure that the begin\n pattern will only match stuff matched by the sub-patterns.\n ", - "begin": "(?x)^\n(?= [ ]{,3}>.\n| ([ ]{4}|\\t)(?!$)\n| [#]{1,6}\\s*+\n| [ ]{,3}(?<marker>[-*_])([ ]{,2}\\k<marker>){2,}[ \\t]*+$\n)" - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(c)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.c" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(cpp)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.c++" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(coffee|coffeescript)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.coffee" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(jade)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.jade" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(css)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.css" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(csharp)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.cs" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(ejs|underscore|lodash)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.ejs" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(erlang)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.erlang" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(diff)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.diff" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(go|golang)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.go" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(graphql)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.graphql" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(hbs|handlebars|html|html5)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "text.html.basic" - }, - { - "include": "text.html.handlebars" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(ini)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.ini" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(java)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.java" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(javascript|js)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.js" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(json)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.json" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|{%\\s*highlight)\\s*(julia|jl)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.julia" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|{%\\s*highlight)\\s*(less)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.css.less" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(ls|livescript|LiveScript)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.livescript" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(lua)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.lua" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(md|markdown)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "text.html.markdown" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(nginx)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.nginx" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(swift)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.swift" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(obj(?:ective\\-|)c)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.objc" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(obj(?:ective\\-|)c\\+\\+)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.objc++" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(perl)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.perl" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(php)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.php" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(python)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.python" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~)\\s*\\{?\\s*(r)(?:[ \\}].*$|\\}?$)", - "patterns": [ - { - "include": "source.r" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(ruby)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.ruby" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(rust)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.rust" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(sass)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.sass" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(scala)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.scala" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(scss)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.scss" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(sh|shell|bash)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.shell" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(sql|mysql|ddl|dml)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.sql" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(postgresql|postgres|pgsql)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.pgsql" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(styl)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.stylus" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(swig|liquid)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "text.html.swig" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(xml)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "text.xml" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "begin": "(```|~~~|{%\\s*highlight)\\s*(yaml)\\s*((?:linenos\\s*)?%})?$", - "patterns": [ - { - "include": "source.yaml" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - } - }, - { - "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown", - "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n", - "captures": { - "1": { - "name": "punctuation.definition.fenced.markdown" - }, - "2": { - "name": "variable.language.fenced.markdown" - }, - "3": { - "name": "punctuation.definition.fenced.markdown" - } - }, - "begin": "(```|~~~|{%\\s*highlight)\\s*(\\w*)\\s*((?:linenos\\s*)?%})?$" - }, - { - "name": "markup.list.unnumbered.markdown", - "end": "^(?=\\S)", - "begin": "^[ ]{0,3}([*+-])(?=\\s)", - "patterns": [ - { - "include": "#list-paragraph" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.list_item.markdown" - } - } - }, - { - "name": "markup.list.numbered.markdown", - "end": "^(?=\\S)", - "begin": "^[ ]{0,3}([0-9]+)(\\.)(?=\\s)", - "patterns": [ - { - "include": "#list-paragraph" - } - ], - "captures": { - "1": { - "name": "punctuation.definition.list_item.markdown punctuation.definition.list_item.number.markdown" - }, - "2": { - "name": "punctuation.definition.list_item.markdown" - } - } - }, - { - "name": "meta.disable-markdown", - "end": "(?<=^</\\1>$\\n)", - "patterns": [ - { - "include": "text.html.basic" - }, - { - "include": "text.html.handlebars" - } - ], - "comment": "\n Markdown formatting is disabled inside block-level tags.\n ", - "begin": "^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\\b)(?!.*?</\\1>)" - }, - { - "name": "meta.disable-markdown", - "end": "$\\n?", - "patterns": [ - { - "include": "text.html.basic" - }, - { - "include": "text.html.handlebars" - } - ], - "comment": "Same rule but for one line disables.", - "begin": "^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\\b)" - }, - { - "name": "meta.link.reference.def.markdown", - "match": "(?x:\n \\s* # Leading whitespace\n (\\[)(.+?)(\\])(:) # Reference name\n [ \\t]* # Optional whitespace\n (<?)(\\S+?)(>?) # The url\n [ \\t]* # Optional whitespace\n (?:\n ((\\().+?(\\))) # Match title in quotes\u2026\n | ((\").+?(\")) # or in parens.\n )? # Title is optional\n \\s* # Optional whitespace\n $\n )", - "captures": { - "4": { - "name": "punctuation.separator.key-value.markdown" - }, - "5": { - "name": "punctuation.definition.link.markdown" - }, - "6": { - "name": "markup.underline.link.markdown" - }, - "7": { - "name": "punctuation.definition.link.markdown" - }, - "10": { - "name": "punctuation.definition.string.end.markdown" - }, - "1": { - "name": "punctuation.definition.constant.markdown" - }, - "2": { - "name": "constant.other.reference.link.markdown" - }, - "3": { - "name": "punctuation.definition.constant.markdown" - }, - "13": { - "name": "punctuation.definition.string.end.markdown" - }, - "8": { - "name": "string.other.link.description.title.markdown" - }, - "9": { - "name": "punctuation.definition.string.begin.markdown" - }, - "12": { - "name": "punctuation.definition.string.begin.markdown" - }, - "11": { - "name": "string.other.link.description.title.markdown" - } - } - }, - { - "name": "meta.paragraph.markdown", - "end": "^(?:\\s*$|(?=[ ]{,3}>.))|(?=[ \\t]*\\n)(?<=^===|^====|=====|^---|^----|-----)[ \\t]*\\n|(?=^#)", - "patterns": [ - { - "include": "#inline" - }, - { - "include": "text.html.handlebars" - }, - { - "name": "markup.heading.1.markdown", - "match": "^(={3,})(?=[ \\t]*$)", - "captures": { - "1": { - "name": "punctuation.definition.heading.markdown" - } - } - }, - { - "name": "markup.heading.2.markdown", - "match": "^(-{3,})(?=[ \\t]*$)", - "captures": { - "1": { - "name": "punctuation.definition.heading.markdown" - } - } - } - ], - "begin": "^(?=\\S)(?![=-]{3,}(?=$))" - } - ], - "fileTypes": [ - "mdown", - "markdown", - "markdn", - "md.hbs", - "md" - ], - "keyEquivalent": "^~M" -} \ No newline at end of file diff --git a/Syntaxes/Markdown Extended.YAML-tmLanguage b/Syntaxes/Markdown Extended.YAML-tmLanguage deleted file mode 100644 index 0b0ea94..0000000 --- a/Syntaxes/Markdown Extended.YAML-tmLanguage +++ /dev/null @@ -1,872 +0,0 @@ -# [PackageDev] target_format: plist, ext: tmLanguage -name: Markdown Extended -scopeName: text.html.markdown -fileTypes: [mdown, markdown, markdn, md.hbs, md] -uuid: dd477cf1-34c4-49d2-ba09-f8445676ccd4 - -patterns: -- name: markup.raw.yaml.front-matter - begin: (?<!\s)---\n$ - end: ^---\s - patterns: - - include: source.yaml - -- name: markup.raw.coffee.front-matter - begin: (?<!\s)---\s*coffee\n$ - end: ^---\s - patterns: - - include: source.coffee - -- name: markup.raw.json.front-matter - begin: (?<!\s)---\s*json\n$ - end: ^---\s - patterns: - - include: source.json - -- comment: "\n We could also use an empty end match and set\n applyEndPatternLast,\ - \ but then we must be sure that the begin\n pattern will only match stuff\ - \ matched by the sub-patterns.\n " - name: meta.block-level.markdown - begin: |- - (?x)^ - (?= [ ]{,3}>. - | ([ ]{4}|\t)(?!$) - | [#]{1,6}\s*+ - | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ - ) - end: |- - (?x)^ - (?! [ ]{,3}>. - | ([ ]{4}|\t) - | [#]{1,6}\s*+ - | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ - ) - patterns: - - include: '#block_quote' - - include: '#block_raw' - - include: '#heading' - - include: '#separator' - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(c)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.c - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(cpp)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.c++ - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(coffee|coffeescript)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.coffee - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(jade)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.jade - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(css)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.css - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(csharp)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.cs - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(ejs|underscore|lodash)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.ejs - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(diff)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.diff - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(go|golang)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.go - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(graphql)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.graphql - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(hbs|handlebars|html|html5)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: text.html.basic - - include: text.html.handlebars - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(java)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.java - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(javascript|js)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.js - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(json)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.json - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|{%\s*highlight)\s*(julia|jl)\s*((?:linenos\s*)?%})?$ - end: (```|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.julia - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|{%\s*highlight)\s*(less)\s*((?:linenos\s*)?%})?$ - end: (```|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.css.less - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(ls|livescript|LiveScript)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.livescript - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(lua)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.lua - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(md|markdown)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: text.html.markdown - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(swift)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.swift - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(obj(?:ective\-|)c)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.objc - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(obj(?:ective\-|)c\+\+)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.objc++ - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(perl)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.perl - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(php)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.php - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(python)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.python - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~)\s*\{?\s*(r)(?:[ \}].*$|\}?$) - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.r - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(ruby)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.ruby - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(rust)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.rust - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(sass)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.sass - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(scala)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.scala - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(scss)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.scss - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(sh|shell|bash)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.shell - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(sql|mysql|ddl|dml)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.sql - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(postgresql|postgres|pgsql)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.pgsql - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(styl)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.stylus - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(swig|liquid)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: text.html.swig - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(xml)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: text.xml - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(yaml)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - patterns: - - include: source.yaml - -- name: markup.raw.block.markdown markup.raw.block.fenced.markdown - begin: (```|~~~|{%\s*highlight)\s*(\w*)\s*((?:linenos\s*)?%})?$ - end: (```|~~~|{%\s*endhighlight\s*%})\n - captures: - '1': {name: punctuation.definition.fenced.markdown} - '2': {name: variable.language.fenced.markdown} - '3': {name: punctuation.definition.fenced.markdown} - -- name: markup.list.unnumbered.markdown - begin: ^[ ]{0,3}([*+-])(?=\s) - end: ^(?=\S) - captures: - '1': {name: punctuation.definition.list_item.markdown} - patterns: - - include: '#list-paragraph' - -- name: markup.list.numbered.markdown - begin: ^[ ]{0,3}([0-9]+)(\.)(?=\s) - end: ^(?=\S) - captures: - '1': {name: punctuation.definition.list_item.markdown punctuation.definition.list_item.number.markdown} - '2': {name: punctuation.definition.list_item.markdown} - patterns: - - include: '#list-paragraph' - -- comment: "\n Markdown formatting is disabled inside block-level tags.\n \ - \ " - name: meta.disable-markdown - begin: ^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)(?!.*?</\1>) - end: (?<=^</\1>$\n) - patterns: - - include: text.html.basic - - include: text.html.handlebars - -- comment: Same rule but for one line disables. - name: meta.disable-markdown - begin: ^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b) - end: $\n? - patterns: - - include: text.html.basic - - include: text.html.handlebars - -- name: meta.link.reference.def.markdown - match: "(?x:\n \\s* # Leading whitespace\n (\\[)(.+?)(\\\ - ])(:) # Reference name\n [ \\t]* # Optional whitespace\n \ - \ (<?)(\\S+?)(>?) # The url\n [ \\t]* # Optional whitespace\n\ - \ (?:\n ((\\().+?(\\))) # Match title in quotes\u2026\n \ - \ | ((\").+?(\")) # or in parens.\n )? # Title is optional\n\ - \ \\s* # Optional whitespace\n $\n )" - captures: - '1': {name: punctuation.definition.constant.markdown} - '2': {name: constant.other.reference.link.markdown} - '3': {name: punctuation.definition.constant.markdown} - '4': {name: punctuation.separator.key-value.markdown} - '5': {name: punctuation.definition.link.markdown} - '6': {name: markup.underline.link.markdown} - '7': {name: punctuation.definition.link.markdown} - '8': {name: string.other.link.description.title.markdown} - '9': {name: punctuation.definition.string.begin.markdown} - '10': {name: punctuation.definition.string.end.markdown} - '11': {name: string.other.link.description.title.markdown} - '12': {name: punctuation.definition.string.begin.markdown} - '13': {name: punctuation.definition.string.end.markdown} - -- name: meta.paragraph.markdown - begin: ^(?=\S)(?![=-]{3,}(?=$)) - end: ^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ - \t]*\n|(?=^#) - patterns: - - include: '#inline' - - include: text.html.handlebars - - name: markup.heading.1.markdown - match: ^(={3,})(?=[ \t]*$) - captures: - '1': {name: punctuation.definition.heading.markdown} - - name: markup.heading.2.markdown - match: ^(-{3,})(?=[ \t]*$) - captures: - '1': {name: punctuation.definition.heading.markdown} - -repository: - ampersand: - comment: "\n Markdown will convert this for us. We match it so that the\n\ - \ HTML grammar will not mark it up as invalid.\n " - name: meta.other.valid-ampersand.markdown - match: '&(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)' - - block_quote: - comment: "\n We terminate the block quote when seeing an empty line, a\n\ - \ separator or a line with leading > characters. The latter is\n \ - \ to \u201Creset\u201D the quote level for quoted lines.\n " - name: markup.quote.markdown - begin: \G[ ]{,3}(>)(?!$)[ ]? - beginCaptures: - '1': {name: punctuation.definition.blockquote.markdown} - end: |- - (?x)^ - (?= \s*$ - | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ - | [ ]{,3}>. - ) - patterns: - - begin: |- - (?x)\G - (?= [ ]{,3}>. - ) - end: ^ - patterns: - - include: '#block_quote' - - begin: |- - (?x)\G - (?= ([ ]{4}|\t) - | [#]{1,6}\s*+ - | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ - ) - end: ^ - patterns: - - include: '#block_raw' - - include: '#heading' - - include: '#separator' - applyEndPatternLast: 1 - - begin: |- - (?x)\G - (?! $ - | [ ]{,3}>. - | ([ ]{4}|\t) - | [#]{1,6}\s*+ - | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ - ) - end: $|(?<=\n) - patterns: - - include: '#inline' - - block_raw: - name: markup.raw.block.markdown - match: \G([ ]{4}|\t).*$\n? - - bold: - name: markup.bold.markdown - begin: |- - (?x) - (\*\*|__)(?=\S) # Open - (?= - ( - <[^>]*+> # HTML tags - | (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> - # Raw - | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes - | \[ - ( - (?<square> # Named group - [^\[\]\\] # Match most chars - | \\. # Escaped chars - | \[ \g<square>*+ \] # Nested brackets - )*+ - \] - ( - ( # Reference Link - [ ]? # Optional space - \[[^\]]*+\] # Ref name - ) - | ( # Inline Link - \( # Opening paren - [ \t]*+ # Optional whtiespace - <?(.*?)>? # URL - [ \t]*+ # Optional whtiespace - ( # Optional Title - (?<title>['"]) - (.*?) - \k<title> - )? - \) - ) - ) - ) - | (?!(?<=\S)\1). # Everything besides - # style closer - )++ - (?<=\S)\1 # Close - ) - end: (?<=\S)(\1) - captures: - '1': {name: punctuation.definition.bold.markdown} - patterns: - - begin: (?=<[^>]*?>) - end: (?<=>) - patterns: - - include: text.html.handlebars - applyEndPatternLast: 1 - - include: '#escape' - - include: '#ampersand' - - include: '#bracket' - - include: '#raw' - - include: '#italic' - - include: '#image-inline' - - include: '#link-inline' - - include: '#link-inet' - - include: '#link-email' - - include: '#image-ref' - - include: '#link-ref-literal' - - include: '#link-ref' - - bracket: - comment: "\n Markdown will convert this for us. We match it so that the\n\ - \ HTML grammar will not mark it up as invalid.\n " - name: meta.other.valid-bracket.markdown - match: <(?![a-z/?\$!]) - - escape: - name: constant.character.escape.markdown - match: \\[-`*_#+.!(){}\[\]\\>] - - heading: - name: markup.heading.markdown - contentName: entity.name.section.markdown - begin: \G(#{1,6})(?!#)\s*(?=\S) - end: \s*(#*)$\n? - captures: - '1': {name: punctuation.definition.heading.markdown} - patterns: - - include: '#inline' - - image-inline: - name: meta.image.inline.markdown - match: "(?x:\n \\! # Images start with !\n (\\[)((?<square>[^\\\ - [\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])\n # Match\ - \ the link text.\n ([ ])? # Space not allowed\n (\\\ - () # Opening paren for url\n (<?)(\\S+?)(>?) # The\ - \ url\n [ \\t]* # Optional whitespace\n (?:\n \ - \ ((\\().+?(\\))) # Match title in parens\u2026\n | ((\"\ - ).+?(\")) # or in quotes.\n )? # Title is optional\n \ - \ \\s* # Optional whitespace\n (\\))\n )" - captures: - '1': {name: punctuation.definition.string.begin.markdown} - '2': {name: string.other.link.description.markdown} - '4': {name: punctuation.definition.string.end.markdown} - '5': {name: invalid.illegal.whitespace.markdown} - '6': {name: punctuation.definition.metadata.markdown} - '7': {name: punctuation.definition.link.markdown} - '8': {name: markup.underline.link.image.markdown} - '9': {name: punctuation.definition.link.markdown} - '10': {name: string.other.link.description.title.markdown} - '11': {name: punctuation.definition.string.markdown} - '12': {name: punctuation.definition.string.markdown} - '13': {name: string.other.link.description.title.markdown} - '14': {name: punctuation.definition.string.markdown} - '15': {name: punctuation.definition.string.markdown} - '16': {name: punctuation.definition.metadata.markdown} - - image-ref: - name: meta.image.reference.markdown - match: \!(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(.*?)(\]) - captures: - '1': {name: punctuation.definition.string.begin.markdown} - '2': {name: string.other.link.description.markdown} - '4': {name: punctuation.definition.string.begin.markdown} - '5': {name: punctuation.definition.constant.markdown} - '6': {name: constant.other.reference.link.markdown} - '7': {name: punctuation.definition.constant.markdown} - - inline: - patterns: - - include: '#escape' - - include: '#ampersand' - - include: '#bracket' - - include: '#raw' - - include: '#bold' - - include: '#italic' - - include: '#line-break' - - include: '#image-inline' - - include: '#link-inline' - - include: '#link-inet' - - include: '#link-email' - - include: '#image-ref' - - include: '#link-ref-literal' - - include: '#link-ref' - - italic: - name: markup.italic.markdown - begin: |- - (?x) - (\*|_)(?=\S) # Open - (?= - ( - <[^>]*+> # HTML tags - | (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> - # Raw - | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes - | \[ - ( - (?<square> # Named group - [^\[\]\\] # Match most chars - | \\. # Escaped chars - | \[ \g<square>*+ \] # Nested brackets - )*+ - \] - ( - ( # Reference Link - [ ]? # Optional space - \[[^\]]*+\] # Ref name - ) - | ( # Inline Link - \( # Opening paren - [ \t]*+ # Optional whtiespace - <?(.*?)>? # URL - [ \t]*+ # Optional whtiespace - ( # Optional Title - (?<title>['"]) - (.*?) - \k<title> - )? - \) - ) - ) - ) - | \1\1 # Must be bold closer - | (?!(?<=\S)\1). # Everything besides - # style closer - )++ - (?<=\S)\1 # Close - ) - end: (?<=\S)(\1)((?!\1)|(?=\1\1)) - captures: - '1': {name: punctuation.definition.italic.markdown} - patterns: - - begin: (?=<[^>]*?>) - end: (?<=>) - patterns: - - include: text.html.handlebars - applyEndPatternLast: 1 - - include: '#escape' - - include: '#ampersand' - - include: '#bracket' - - include: '#raw' - - include: '#bold' - - include: '#image-inline' - - include: '#link-inline' - - include: '#link-inet' - - include: '#link-email' - - include: '#image-ref' - - include: '#link-ref-literal' - - include: '#link-ref' - - line-break: - name: meta.dummy.line-break - match: ' {2,}$' - - link-email: - name: meta.link.email.lt-gt.markdown - match: (<)((?:mailto:)?[-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(>) - captures: - '1': {name: punctuation.definition.link.markdown} - '2': {name: markup.underline.link.markdown} - '4': {name: punctuation.definition.link.markdown} - - link-inet: - name: meta.link.inet.markdown - match: (<)((?:https?|ftp)://.*?)(>) - captures: - '1': {name: punctuation.definition.link.markdown} - '2': {name: markup.underline.link.markdown} - '3': {name: punctuation.definition.link.markdown} - - link-inline: - name: meta.link.inline.markdown - match: "(?x:\n (\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\\ - ])\n # Match the link text.\n ([ ])? \ - \ # Space not allowed\n (\\() # Opening paren for url\n \ - \ (<?)(.*?)(>?) # The url\n [ \\t]* # Optional\ - \ whitespace\n (?:\n ((\\().+?(\\))) # Match title in\ - \ parens\u2026\n | ((\").+?(\")) # or in quotes.\n )?\ - \ # Title is optional\n \\s* # Optional whitespace\n\ - \ (\\))\n )" - captures: - '1': {name: punctuation.definition.string.begin.markdown} - '2': {name: string.other.link.title.markdown} - '4': {name: punctuation.definition.string.end.markdown} - '5': {name: invalid.illegal.whitespace.markdown} - '6': {name: punctuation.definition.metadata.markdown} - '7': {name: punctuation.definition.link.markdown} - '8': {name: markup.underline.link.markdown} - '9': {name: punctuation.definition.link.markdown} - '10': {name: string.other.link.description.title.markdown} - '11': {name: punctuation.definition.string.begin.markdown} - '12': {name: punctuation.definition.string.end.markdown} - '13': {name: string.other.link.description.title.markdown} - '14': {name: punctuation.definition.string.begin.markdown} - '15': {name: punctuation.definition.string.end.markdown} - '16': {name: punctuation.definition.metadata.markdown} - - link-ref: - name: meta.link.reference.markdown - match: (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)([^\]]*+)(\]) - captures: - '1': {name: punctuation.definition.string.begin.markdown} - '2': {name: string.other.link.title.markdown} - '4': {name: punctuation.definition.string.end.markdown} - '5': {name: punctuation.definition.constant.begin.markdown} - '6': {name: constant.other.reference.link.markdown} - '7': {name: punctuation.definition.constant.end.markdown} - - link-ref-literal: - name: meta.link.reference.literal.markdown - match: (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(\]) - captures: - '1': {name: punctuation.definition.string.begin.markdown} - '2': {name: string.other.link.title.markdown} - '4': {name: punctuation.definition.string.end.markdown} - '5': {name: punctuation.definition.constant.begin.markdown} - '6': {name: punctuation.definition.constant.end.markdown} - - list-paragraph: - patterns: - - name: meta.paragraph.list.markdown - begin: \G\s+(?=\S) - end: ^\s*$ - patterns: - - include: '#inline' - - raw: - name: markup.raw.inline.markdown - match: (`+)([^`]|(?!(?<!`)\1(?!`))`)*+(\1) - captures: - '1': {name: punctuation.definition.raw.markdown} - '3': {name: punctuation.definition.raw.markdown} - - separator: - name: meta.separator.markdown - match: \G[ ]{,3}([-*_])([ ]{,2}\1){2,}[ \t]*$\n? -foldingStartMarker: |- - (?x) - (<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\b.*?> - |<!--(?!.*-->) - |\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/))) - ) -foldingStopMarker: |- - (?x) - (</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)> - |^\s*--> - |(^|\s)\} - ) -keyEquivalent: ^~M diff --git a/Syntaxes/Markdown Extended.sublime-syntax b/Syntaxes/Markdown Extended.sublime-syntax index 2f2f8f4..0aa96e0 100644 --- a/Syntaxes/Markdown Extended.sublime-syntax +++ b/Syntaxes/Markdown Extended.sublime-syntax @@ -1,59 +1,94 @@ %YAML 1.2 --- # http://www.sublimetext.com/docs/3/syntax.html -name: Markdown Extended -file_extensions: - - mdown - - markdown - - markdn - - md.hbs - - md +name: Markdown Extended Dev +file_extensions: [mkdown, mdown, markdown, markdn, md.hbs, md] scope: text.html.markdown + contexts: + # lookahead for front-matter main: - - match: (?=(?<!\s)---(\s*coffee|\s*json)?\n$) + - match: (?=\A-{3}(\w*)[^\S\n]*$) push: front-matter - match: "" set: body + + # begin front-matter front-matter: - - match: ^\s*---\s*$ + - match: ^(---)(ya?ml)? *$ + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown with_prototype: - include: scope:source.yaml#prototype push: - - meta_scope: markup.raw.yaml.front-matter + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - meta_content_scope: source.yaml - - match: ^\s*---\s* + - match: ^(---|\.{3}) *$ + captures: + 1: punctuation.definition.fenced.markdown pop: true - include: scope:source.yaml - - match: ^\s*---\s*coffee\s*$ + + - match: ^(---)(coffee) *$ + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + with_prototype: + - include: scope:source.coffee#prototype push: - - meta_scope: markup.raw.coffee.front-matter + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - meta_content_scope: source.coffee - - match: ^\s*---\s* + - match: ^(---|\.{3}) *$ + captures: + 1: punctuation.definition.fenced.markdown pop: true - include: scope:source.coffee - - match: ^\s*---\s*json\s*$ + + - match: ^(---)(json) *$ + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + with_prototype: + - include: scope:source.json#prototype push: - - meta_scope: markup.raw.json.front-matter + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - meta_content_scope: source.json - - match: ^\s*---\s* + - match: ^(---|\.{3}) *$ + captures: + 1: punctuation.definition.fenced.markdown pop: true - include: scope:source.json + + - match: ^(---)(\w*) *$ + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + with_prototype: + - include: scope:text.plain#prototype + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.plain + - match: ^(---|\.{3}) *$ + captures: + 1: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.plain + - match: "" pop: true set: body + + # begin body body: - match: |- (?x)^ (?= [ ]{,3}>. | ([ ]{4}|\t)(?!$) | [#]{1,6}\s*+ - | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[^\S\n]*+$ ) - comment: | - We could also use an empty end match and set - applyEndPatternLast, but then we must be sure that the begin - pattern will only match stuff matched by the sub-patterns. + comment: "We could also use an empty end match and set applyEndPatternLast, but then we must be sure that the begin pattern will only match stuff matched by the sub-patterns." push: - meta_scope: meta.block-level.markdown - match: |- @@ -61,13 +96,83 @@ contexts: (?! [ ]{,3}>. | ([ ]{4}|\t) | [#]{1,6}\s*+ - | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[^\S\n]*+$ ) pop: true - include: block_quote - include: block_raw - include: heading - include: separator + + # fenced markdown: applescript + - match: '(```|~~~|{%\s*highlight)\s*(applescript)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.applescript + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.applescript + + # fenced markdown: asp + - match: '(```|~~~|{%\s*highlight)\s*(asp)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.asp + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.asp + + # fenced markdown: bash + - match: '(```|~~~|{%\s*highlight)\s*(bash|sh|shell)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.shell + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.shell + + # fenced markdown: bibtex + - match: '(```|~~~|{%\s*highlight)\s*(bibtex)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.bibtex + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.bibtex + + # fenced markdown: c - match: '(```|~~~|{%\s*highlight)\s*(c)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown @@ -75,635 +180,1353 @@ contexts: 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.c + - meta_content_scope: source.c + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.c + + # fenced markdown: clojure + - match: '(```|~~~|{%\s*highlight)\s*(clojure)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.clojure + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.clojure + + # fenced markdown: cmake + - match: '(```|~~~|{%\s*highlight)\s*(cmake)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.cmake + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.cmake + + # fenced markdown: coffee + - match: '(```|~~~|{%\s*highlight)\s*(coffee|coffeescript)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.coffee + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.coffee + + # fenced markdown: cpp + - match: '(```|~~~|{%\s*highlight)\s*(cpp)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.c++ + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.c++ + + # fenced markdown: csharp + - match: '(```|~~~|{%\s*highlight)\s*(csharp)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.cs + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.cs + + # fenced markdown: css + - match: '(```|~~~|{%\s*highlight)\s*(css)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.css + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.css + + # fenced markdown: d + - match: '(```|~~~|{%\s*highlight)\s*(d)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.d + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.d + + # fenced markdown: ddl + - match: '(```|~~~|{%\s*highlight)\s*(ddl|dml|mysql|sql)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.sql + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.sql + + # fenced markdown: diff + - match: '(```|~~~|{%\s*highlight)\s*(diff)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.diff + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.diff + + # fenced markdown: dockerfile + - match: '(```|~~~|{%\s*highlight)\s*(dockerfile)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.dockerfile + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.dockerfile + + # fenced markdown: dosbatch + - match: '(```|~~~|{%\s*highlight)\s*(dosbatch)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.dosbatch + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.dosbatch + + # fenced markdown: dot + - match: '(```|~~~|{%\s*highlight)\s*(dot)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.dot + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.dot + + # fenced markdown: editorconfig + - match: '(```|~~~|{%\s*highlight)\s*(editorconfig)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.ini.editorconfig + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.ini.editorconfig + + # fenced markdown: ejs + - match: '(```|~~~|{%\s*highlight)\s*(ejs|lodash|underscore)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.ejs + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.ejs + + # fenced markdown: erb + - match: '(```|~~~|{%\s*highlight)\s*(erb|html\+ruby|rails)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.html.ruby + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.html.ruby + + # fenced markdown: erlang + - match: '(```|~~~|{%\s*highlight)\s*(erlang)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.erlang + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.erlang + + # fenced markdown: git + - match: '(```|~~~|{%\s*highlight)\s*(git)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.git + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.git + + # fenced markdown: go + - match: '(```|~~~|{%\s*highlight)\s*(go|golang)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.go + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.go + + # fenced markdown: gradle + - match: '(```|~~~|{%\s*highlight)\s*(gradle)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.gradle + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.gradle + + # fenced markdown: graphql + - match: '(```|~~~|{%\s*highlight)\s*(graphql)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.graphql + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.graphql + + # fenced markdown: groovy + - match: '(```|~~~|{%\s*highlight)\s*(groovy)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.groovy + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.groovy + + # fenced markdown: gruntfile.coffee + - match: '(```|~~~|{%\s*highlight)\s*(gruntfile\.coffee)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.gruntfile.coffee + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.gruntfile.coffee + + # fenced markdown: gruntfile.js + - match: '(```|~~~|{%\s*highlight)\s*(gruntfile\.js)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.gruntfile.js + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.gruntfile.js + + # fenced markdown: gulpfile.coffee + - match: '(```|~~~|{%\s*highlight)\s*(gulpfile\.coffee)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.gulpfile.coffee + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.gulpfile.coffee + + # fenced markdown: gulpfile.js + - match: '(```|~~~|{%\s*highlight)\s*(gulpfile\.js)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.gulpfile.js + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.gulpfile.js + + # fenced markdown: haml + - match: '(```|~~~|{%\s*highlight)\s*(haml)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.haml + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.haml + + # fenced markdown: handlebars + - match: '(```|~~~|{%\s*highlight)\s*(handlebars|hbs|html|html5)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.html.basic + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.html.basic + - include: scope:text.html.handlebars + + # fenced markdown: haskell + - match: '(```|~~~|{%\s*highlight)\s*(haskell)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.haskell + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.haskell + + # fenced markdown: ini + - match: '(```|~~~|{%\s*highlight)\s*(ini)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.ini + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.ini + + # fenced markdown: jade + - match: '(```|~~~|{%\s*highlight)\s*(jade)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.jade + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.jade + + # fenced markdown: java + - match: '(```|~~~|{%\s*highlight)\s*(java)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.java + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.java + + # fenced markdown: javadoc + - match: '(```|~~~|{%\s*highlight)\s*(javadoc)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.html.javadoc + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.html.javadoc + + # fenced markdown: jl + - match: '(```|~~~|{%\s*highlight)\s*(jl|julia)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.julia + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.julia + + # fenced markdown: json + - match: '(```|~~~|{%\s*highlight)\s*(json)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.json + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.json + + # fenced markdown: jsx + - match: '(```|~~~|{%\s*highlight)\s*(jsx)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.jsx + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.jsx + + # fenced markdown: latex + - match: '(```|~~~|{%\s*highlight)\s*(latex)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.tex.latex + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.tex.latex + + # fenced markdown: less + - match: '(```|~~~|{%\s*highlight)\s*(less)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.less - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.c - - match: '(```|~~~|{%\s*highlight)\s*(cpp)\s*((?:linenos\s*)?%})?$' + - include: scope:source.less + + # fenced markdown: liquid + - match: '(```|~~~|{%\s*highlight)\s*(liquid|swig)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.c++ + - meta_content_scope: text.html.swig - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.c++ - - match: '(```|~~~|{%\s*highlight)\s*(coffee|coffeescript)\s*((?:linenos\s*)?%})?$' + - include: scope:text.html.swig + + # fenced markdown: LiveScript + - match: '(```|~~~|{%\s*highlight)\s*(LiveScript|livescript|ls)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.coffee + - meta_content_scope: source.livescript - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.coffee - - match: '(```|~~~|{%\s*highlight)\s*(jade)\s*((?:linenos\s*)?%})?$' + - include: scope:source.livescript + + # fenced markdown: lua + - match: '(```|~~~|{%\s*highlight)\s*(lua)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.jade + - meta_content_scope: source.lua - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.jade - - match: '(```|~~~|{%\s*highlight)\s*(css)\s*((?:linenos\s*)?%})?$' + - include: scope:source.lua + + # fenced markdown: makefile + - match: '(```|~~~|{%\s*highlight)\s*(makefile)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.css + - meta_content_scope: source.makefile - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.css - - match: '(```|~~~|{%\s*highlight)\s*(csharp)\s*((?:linenos\s*)?%})?$' + - include: scope:source.makefile + + # fenced markdown: markdown + - match: '(```|~~~|{%\s*highlight)\s*(markdown|md)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.cs + - meta_content_scope: text.html.multimarkdown - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.cs - - match: '(```|~~~|{%\s*highlight)\s*(ejs|underscore|lodash)\s*((?:linenos\s*)?%})?$' + - include: scope:text.html.multimarkdown + + # fenced markdown: math + - match: '(```|~~~|{%\s*highlight)\s*(math)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.ejs + - meta_content_scope: text.tex.math - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.ejs - - match: '(```|~~~|{%\s*highlight)\s*(erlang)\s*((?:linenos\s*)?%})?$' + - include: scope:text.tex.math + + # fenced markdown: matlab + - match: '(```|~~~|{%\s*highlight)\s*(matlab)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.erlang + - meta_content_scope: source.matlab - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.erlang - - match: '(```|~~~|{%\s*highlight)\s*(diff)\s*((?:linenos\s*)?%})?$' + - include: scope:source.matlab + + # fenced markdown: mustache + - match: '(```|~~~|{%\s*highlight)\s*(mustache)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.diff + - meta_content_scope: text.html.mustache - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.diff - - match: '(```|~~~|{%\s*highlight)\s*(go|golang)\s*((?:linenos\s*)?%})?$' + - include: scope:text.html.mustache + + # fenced markdown: nginx + - match: '(```|~~~|{%\s*highlight)\s*(nginx)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.go + - meta_content_scope: source.nginx - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.go - - match: '(```|~~~|{%\s*highlight)\s*(graphql)\s*((?:linenos\s*)?%})?$' + - include: scope:source.nginx + + # fenced markdown: objc + - match: '(```|~~~|{%\s*highlight)\s*(objc|objective-c)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.graphql + - meta_content_scope: source.objc - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.graphql - - match: '(```|~~~|{%\s*highlight)\s*(hbs|handlebars|html|html5)\s*((?:linenos\s*)?%})?$' + - include: scope:source.objc + + # fenced markdown: objc++ + - match: '(```|~~~|{%\s*highlight)\s*(objc\+\+|objective-c\+\+)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: text.html.basic + - meta_content_scope: source.objc++ - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:text.html.basic - - include: scope:text.html.handlebars - - match: '(```|~~~|{%\s*highlight)\s*(ini)\s*((?:linenos\s*)?%})?$' + - include: scope:source.objc++ + + # fenced markdown: ocaml + - match: '(```|~~~|{%\s*highlight)\s*(ocaml)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.ini + - meta_content_scope: source.ocaml - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.ini - - match: '(```|~~~|{%\s*highlight)\s*(java)\s*((?:linenos\s*)?%})?$' + - include: scope:source.ocaml + + # fenced markdown: ocamllex + - match: '(```|~~~|{%\s*highlight)\s*(ocamllex)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.java + - meta_content_scope: source.ocamllex - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.java - - match: '(```|~~~|{%\s*highlight)\s*(javascript|js)\s*((?:linenos\s*)?%})?$' + - include: scope:source.ocamllex + + # fenced markdown: ocamlyacc + - match: '(```|~~~|{%\s*highlight)\s*(ocamlyacc)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.js + - meta_content_scope: source.ocamlyacc - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.js - - match: '(```|~~~|{%\s*highlight)\s*(json)\s*((?:linenos\s*)?%})?$' + - include: scope:source.ocamlyacc + + # fenced markdown: pascal + - match: '(```|~~~|{%\s*highlight)\s*(pascal)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.json + - meta_content_scope: source.pascal - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.json - - match: '(```|{%\s*highlight)\s*(julia|jl)\s*((?:linenos\s*)?%})?$' + - include: scope:source.pascal + + # fenced markdown: perl + - match: '(```|~~~|{%\s*highlight)\s*(perl)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.julia - - match: '(```|{%\s*endhighlight\s*%})\n' + - meta_content_scope: source.perl + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.julia - - match: '(```|{%\s*highlight)\s*(less)\s*((?:linenos\s*)?%})?$' + - include: scope:source.perl + + # fenced markdown: pgsql + - match: '(```|~~~|{%\s*highlight)\s*(pgsql|postgres|postgresql)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.css.less - - match: '(```|{%\s*endhighlight\s*%})\n' + - meta_content_scope: source.pgsql + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.css.less - - match: '(```|~~~|{%\s*highlight)\s*(ls|livescript|LiveScript)\s*((?:linenos\s*)?%})?$' + - include: scope:source.pgsql + + # fenced markdown: php + - match: '(```|~~~|{%\s*highlight)\s*(php)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.livescript + - meta_content_scope: source.php - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.livescript - - match: '(```|~~~|{%\s*highlight)\s*(lua)\s*((?:linenos\s*)?%})?$' + - include: scope:source.php + + # fenced markdown: plain + - match: '(```|~~~|{%\s*highlight)\s*(plain)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.lua + - meta_content_scope: text.plain - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.lua - - match: '(```|~~~|{%\s*highlight)\s*(md|markdown)\s*((?:linenos\s*)?%})?$' + - include: scope:text.plain + + # fenced markdown: procfile + - match: '(```|~~~|{%\s*highlight)\s*(procfile)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: text.html.markdown + - meta_content_scope: source.procfile - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:text.html.markdown - - match: '(```|~~~|{%\s*highlight)\s*(nginx)\s*((?:linenos\s*)?%})?$' + - include: scope:source.procfile + + # fenced markdown: puppet + - match: '(```|~~~|{%\s*highlight)\s*(puppet)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.nginx + - meta_content_scope: source.puppet - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.nginx - - match: '(```|~~~|{%\s*highlight)\s*(swift)\s*((?:linenos\s*)?%})?$' + - include: scope:source.puppet + + # fenced markdown: python + - match: '(```|~~~|{%\s*highlight)\s*(python)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.swift + - meta_content_scope: source.python - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.swift - - match: '(```|~~~|{%\s*highlight)\s*(obj(?:ective\-|)c)\s*((?:linenos\s*)?%})?$' + - include: scope:source.python + + # fenced markdown: regexp + - match: '(```|~~~|{%\s*highlight)\s*(regexp)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.objc + - meta_content_scope: source.regexp - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.objc - - match: '(```|~~~|{%\s*highlight)\s*(obj(?:ective\-|)c\+\+)\s*((?:linenos\s*)?%})?$' + - include: scope:source.regexp + + # fenced markdown: regexp.pyjade + - match: '(```|~~~|{%\s*highlight)\s*(regexp\.pyjade)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.objc++ + - meta_content_scope: source.pyjade - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.objc++ - - match: '(```|~~~|{%\s*highlight)\s*(perl)\s*((?:linenos\s*)?%})?$' + - include: scope:source.pyjade + + # fenced markdown: regexp.python + - match: '(```|~~~|{%\s*highlight)\s*(regexp\.python)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.perl + - meta_content_scope: source.regexp.python - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.perl - - match: '(```|~~~|{%\s*highlight)\s*(php)\s*((?:linenos\s*)?%})?$' + - include: scope:source.regexp.python + + # fenced markdown: ruby + - match: '(```|~~~|{%\s*highlight)\s*(ruby)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.php + - meta_content_scope: source.ruby - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.php - - match: '(```|~~~|{%\s*highlight)\s*(python)\s*((?:linenos\s*)?%})?$' + - include: scope:source.ruby + + # fenced markdown: rust + - match: '(```|~~~|{%\s*highlight)\s*(rust)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.python + - meta_content_scope: source.rust - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.python - - match: '(```|~~~)\s*\{?\s*(r)(?:[ \},].*$|\}?$)' + - include: scope:source.rust + + # fenced markdown: sass + - match: '(```|~~~|{%\s*highlight)\s*(sass)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.r + - meta_content_scope: source.sass - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.r - - match: '(```|~~~|{%\s*highlight)\s*(ruby)\s*((?:linenos\s*)?%})?$' + - include: scope:source.sass + + # fenced markdown: scala + - match: '(```|~~~|{%\s*highlight)\s*(scala)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.ruby + - meta_content_scope: source.scala - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.ruby - - match: '(```|~~~|{%\s*highlight)\s*(rails|erb|html\+ruby)\s*((?:linenos\s*)?%})?$' + - include: scope:source.scala + + # fenced markdown: scss + - match: '(```|~~~|{%\s*highlight)\s*(scss)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.scss - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - match: '' - push: - - meta_content_scope: text.html.ruby - - include: scope:text.html.ruby - with_prototype: - - match: '(?=(```|~~~|{%\s*endhighlight\s*%})\n)' - pop: true - - match: '(```|~~~|{%\s*highlight)\s*(rust)\s*((?:linenos\s*)?%})?$' + - include: scope:source.scss + + # fenced markdown: styl + - match: '(```|~~~|{%\s*highlight)\s*(styl)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.rust + - meta_content_scope: source.stylus - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.rust - - match: '(```|~~~|{%\s*highlight)\s*(sass)\s*((?:linenos\s*)?%})?$' + - include: scope:source.stylus + + # fenced markdown: swift + - match: '(```|~~~|{%\s*highlight)\s*(swift)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.sass + - meta_content_scope: source.swift - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.sass - - match: '(```|~~~|{%\s*highlight)\s*(scala)\s*((?:linenos\s*)?%})?$' + - include: scope:source.swift + + # fenced markdown: tex + - match: '(```|~~~|{%\s*highlight)\s*(tex)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.scala + - meta_content_scope: text.tex - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.scala - - match: '(```|~~~|{%\s*highlight)\s*(scss)\s*((?:linenos\s*)?%})?$' + - include: scope:text.tex + + # fenced markdown: textile + - match: '(```|~~~|{%\s*highlight)\s*(textile)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.scss + - meta_content_scope: text.html.textile - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.scss - - match: '(```|~~~|{%\s*highlight)\s*(sh|shell|bash)\s*((?:linenos\s*)?%})?$' + - include: scope:text.html.textile + + # fenced markdown: todo + - match: '(```|~~~|{%\s*highlight)\s*(todo)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.shell + - meta_content_scope: text.todo - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.shell - - match: '(```|~~~|{%\s*highlight)\s*(sql|mysql|ddl|dml)\s*((?:linenos\s*)?%})?$' + - include: scope:text.todo + + # fenced markdown: twig + - match: '(```|~~~|{%\s*highlight)\s*(twig)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.sql + - meta_content_scope: text.html.twig - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.sql - - match: '(```|~~~|{%\s*highlight)\s*(postgresql|postgres|pgsql)\s*((?:linenos\s*)?%})?$' + - include: scope:text.html.twig + + # fenced markdown: xml + - match: '(```|~~~|{%\s*highlight)\s*(xml)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.pgsql + - meta_content_scope: text.xml - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.pgsql - - match: '(```|~~~|{%\s*highlight)\s*(styl)\s*((?:linenos\s*)?%})?$' + - include: scope:text.xml + + # fenced markdown: yaml + - match: '(```|~~~|{%\s*highlight)\s*(yaml)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.stylus + - meta_content_scope: source.yaml - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.stylus - - match: '(```|~~~|{%\s*highlight)\s*(swig|liquid)\s*((?:linenos\s*)?%})?$' + - include: scope:source.yaml + + # fenced markdown: javascript + - match: '(```|~~~|{%\s*highlight)\s*(javascript|js)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: text.html.swig - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:text.html.swig - - match: '(```|~~~|{%\s*highlight)\s*(xml)\s*((?:linenos\s*)?%})?$' + - match: '' + push: + - meta_content_scope: source.js + - include: scope:source.js + with_prototype: + - match: '(?=(```|~~~|{%\s*endhighlight\s*%})\n)' + pop: true + + # fenced markdown: r + - match: '(```|~~~)\s*\{?\s*(r)(?:[ \},].*$|\}?$)' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: text.xml + - meta_content_scope: source.r - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:text.xml - - match: '(```|~~~|{%\s*highlight)\s*(yaml)\s*((?:linenos\s*)?%})?$' + - include: scope:source.r + + # fenced markdown: rails + - match: '(```|~~~|{%\s*highlight)\s*(rails|erb|html\+ruby)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown push: - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown - - meta_content_scope: source.yaml - match: '(```|~~~|{%\s*endhighlight\s*%})\n' captures: 1: punctuation.definition.fenced.markdown 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true - - include: scope:source.yaml + - match: '' + push: + - meta_content_scope: text.html.ruby + - include: scope:text.html.ruby + with_prototype: + - match: '(?=(```|~~~|{%\s*endhighlight\s*%})\n)' + pop: true + + # fenced markdown: generic - match: '(```|~~~|{%\s*highlight)\s*(\w*)\s*((?:linenos\s*)?%})?$' captures: 1: punctuation.definition.fenced.markdown @@ -717,6 +1540,8 @@ contexts: 2: variable.language.fenced.markdown 3: punctuation.definition.fenced.markdown pop: true + + # lists - match: '^[ ]{0,3}([*+-])(?=\s)' captures: 1: punctuation.definition.list_item.markdown @@ -739,6 +1564,8 @@ contexts: 2: punctuation.definition.list_item.markdown pop: true - include: list-paragraph + + # html tags - match: '^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)(?!.*?</\1>)' comment: Markdown formatting is disabled inside block-level tags. push: @@ -747,6 +1574,7 @@ contexts: pop: true - include: scope:text.html.basic - include: scope:text.html.handlebars + - match: '^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)' comment: Same rule but for one line disables. push: @@ -755,20 +1583,21 @@ contexts: pop: true - include: scope:text.html.basic - include: scope:text.html.handlebars - - match: |- - (?x: - \s* # Leading whitespace - (\[)(.+?)(\])(:) # Reference name - [ \t]* # Optional whitespace - (<?)(\S+?)(>?) # The url - [ \t]* # Optional whitespace - (?: - ((\().+?(\))) # Match title in quotes… - | ((").+?(")) # or in parens. - )? # Title is optional - \s* # Optional whitespace - $ - ) + - match: (?x:\s*(\[)(.+?)(\])(:)(?:[^\S\n]*(<?)(\S+?)(>?))?[^\S\n]*(?:((\().+?(\)))|((").+?(")))?\s*$) + # - match: |- + # (?x: + # \s* # Leading whitespace + # (\[)(.+?)(\])(:) # Reference name + # [^\S\n]* # Optional whitespace + # (<?)(\S+?)(>?) # The url + # [^\S\n]* # Optional whitespace + # (?: + # ((\().+?(\))) # Match title in quotes… + # | ((").+?(")) # or in parens. + # )? # Title is optional + # \s* # Optional whitespace + # $ + # ) scope: meta.link.reference.def.markdown captures: 1: punctuation.definition.constant.markdown @@ -788,15 +1617,15 @@ contexts: push: - meta_scope: meta.paragraph.markdown - include: html_comment - - match: '^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ \t]*\n|(?=^#)' + - match: '^(?:\s*$|(?=[ ]{,3}>.))|(?=[^\S\n]*\n)(?<=^===|^====|=====|^---|^----|-----)[^\S\n]*\n|(?=^#)' pop: true - include: inline - include: scope:text.html.handlebars - - match: '^(={3,})(?=[ \t]*$)' + - match: '^(={3,})(?=[^\S\n]*$)' scope: markup.heading.1.markdown captures: 1: punctuation.definition.heading.markdown - - match: '^(-{3,})(?=[ \t]*$)' + - match: '^(-{3,})(?=[^\S\n]*$)' scope: markup.heading.2.markdown captures: 1: punctuation.definition.heading.markdown @@ -809,20 +1638,16 @@ contexts: - meta_scope: comment.block.html - match: '--\s*>' pop: true - - match: "--" + - match: '--' scope: invalid.illegal.bad-comments-or-CDATA.html ampersand: - - match: "&(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)" - comment: | - Markdown will convert this for us. We match it so that the - HTML grammar will not mark it up as invalid. + - comment: "Markdown will convert this for us. We match it so that the HTML grammar will not mark it up as invalid." + match: '&(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)' scope: meta.other.valid-ampersand.markdown + block_quote: - - match: '\G[ ]{,3}(>)(?!$)[ ]?' - comment: | - We terminate the block quote when seeing an empty line, a - separator or a line with leading > characters. The latter is - to “reset” the quote level for quoted lines. + - comment: "We terminate the block quote when seeing an empty line, a separator or a line with leading > characters. The latter is to “reset” the quote level for quoted lines." + match: '\G[ ]{,3}(>)(?!$)[ ]?' captures: 1: punctuation.definition.blockquote.markdown push: @@ -830,14 +1655,11 @@ contexts: - match: |- (?x)^ (?= \s*$ - | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[^\S\n]*+$ | [ ]{,3}>. ) pop: true - - match: |- - (?x)\G - (?= [ ]{,3}>. - ) + - match: \G(?= [ ]{,3}>.) push: - match: ^ pop: true @@ -846,7 +1668,7 @@ contexts: (?x)\G (?= ([ ]{4}|\t) | [#]{1,6}\s*+ - | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[^\S\n]*+$ ) push: - include: block_raw @@ -860,7 +1682,7 @@ contexts: | [ ]{,3}>. | ([ ]{4}|\t) | [#]{1,6}\s*+ - | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[^\S\n]*+$ ) push: - match: $|(?<=\n) @@ -872,32 +1694,32 @@ contexts: bold: - match: |- (?x) - (\*\*|__)(?=\S) # Open + (\*\*|__)(?=\S) # Open (?= ( - <[^>]*+> # HTML tags + <[^>]*+> # HTML tags | (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> - # Raw - | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes + # Raw + | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes | \[ ( - (?<square> # Named group - [^\[\]\\] # Match most chars - | \\. # Escaped chars - | \[ \g<square>*+ \] # Nested brackets - )*+ + (?<square> # Named group + [^\[\]\\] # Match most chars + | \\. # Escaped chars + | \[ \g<square>*+ \] # Nested brackets + )*+ \] ( - ( # Reference Link - [ ]? # Optional space - \[[^\]]*+\] # Ref name + ( # Reference Link + [ ]? # Optional space + \[[^\]]*+\] # Ref name ) - | ( # Inline Link - \( # Opening paren - [ \t]*+ # Optional whtiespace - <?(.*?)>? # URL - [ \t]*+ # Optional whtiespace - ( # Optional Title + | ( # Inline Link + \( # Opening paren + [^\S\n]*+ # Optional whitespace + <?(.*?)>? # URL + [^\S\n]*+ # Optional whitespace + ( # Optional Title (?<title>['"]) (.*?) \k<title> @@ -906,10 +1728,10 @@ contexts: ) ) ) - | (?!(?<=\S)\1). # Everything besides - # style closer + | (?!(?<=\S)\1). # Everything besides + # style closer )++ - (?<=\S)\1 # Close + (?<=\S)\1 # Close ) captures: 1: punctuation.definition.bold.markdown @@ -934,9 +1756,9 @@ contexts: - include: link-inline - include: link-inet - include: link-email - - include: image-ref - - include: link-ref-literal - - include: link-ref + - include: image-reference + - include: link-reference-literal + - include: link-reference bracket: - match: '<(?![a-z/?\$!])' comment: | @@ -952,7 +1774,7 @@ contexts: 1: punctuation.definition.heading.markdown push: - meta_scope: markup.heading.markdown markup.heading.1.markdown - - match: \s*(#*)$\n? + - match: '\s*(#*)$\n?' captures: 1: punctuation.definition.heading.markdown pop: true @@ -962,7 +1784,7 @@ contexts: 1: punctuation.definition.heading.markdown push: - meta_scope: markup.heading.markdown markup.heading.2.markdown - - match: \s*(#*)$\n? + - match: '\s*(#*)$\n?' captures: 1: punctuation.definition.heading.markdown pop: true @@ -972,7 +1794,7 @@ contexts: 1: punctuation.definition.heading.markdown push: - meta_scope: markup.heading.markdown markup.heading.3.markdown - - match: \s*(#*)$\n? + - match: '\s*(#*)$\n?' captures: 1: punctuation.definition.heading.markdown pop: true @@ -982,7 +1804,7 @@ contexts: 1: punctuation.definition.heading.markdown push: - meta_scope: markup.heading.markdown markup.heading.4.markdown - - match: \s*(#*)$\n? + - match: '\s*(#*)$\n?' captures: 1: punctuation.definition.heading.markdown pop: true @@ -992,7 +1814,7 @@ contexts: 1: punctuation.definition.heading.markdown push: - meta_scope: markup.heading.markdown markup.heading.5.markdown - - match: \s*(#*)$\n? + - match: '\s*(#*)$\n?' captures: 1: punctuation.definition.heading.markdown pop: true @@ -1002,7 +1824,7 @@ contexts: 1: punctuation.definition.heading.markdown push: - meta_scope: markup.heading.markdown markup.heading.6.markdown - - match: \s*(#*)$\n? + - match: '\s*(#*)$\n?' captures: 1: punctuation.definition.heading.markdown pop: true @@ -1010,18 +1832,18 @@ contexts: image-inline: - match: |- (?x: - \! # Images start with ! + \! # Images start with ! (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) - # Match the link text. - ([ ])? # Space not allowed - (\() # Opening paren for url + # Match the link text. + ([ ])? # Space not allowed + (\() # Opening paren for url (<?)(\S+?)(>?) # The url - [ \t]* # Optional whitespace + [^\S\n]* # Optional whitespace (?: ((\().+?(\))) # Match title in parens… - | ((").+?(")) # or in quotes. - )? # Title is optional - \s* # Optional whitespace + | ((").+?(")) # or in quotes. + )? # Title is optional + \s* # Optional whitespace (\)) ) scope: meta.image.inline.markdown @@ -1041,8 +1863,8 @@ contexts: 14: punctuation.definition.string.markdown 15: punctuation.definition.string.markdown 16: punctuation.definition.metadata.markdown - image-ref: - - match: '\!(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(.*?)(\])' + image-reference: + - match: '\!(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*)(\])[ ]?(\[)(.*?)(\])' scope: meta.image.reference.markdown captures: 1: punctuation.definition.string.begin.markdown @@ -1064,9 +1886,9 @@ contexts: - include: link-inline - include: link-inet - include: link-email - - include: image-ref - - include: link-ref-literal - - include: link-ref + - include: image-reference + - include: link-reference-literal + - include: link-reference - include: latex-inline italic: - match: |- @@ -1093,9 +1915,9 @@ contexts: ) | ( # Inline Link \( # Opening paren - [ \t]*+ # Optional whtiespace + [^\S\n]*+ # Optional whtiespace <?(.*?)>? # URL - [ \t]*+ # Optional whtiespace + [^\S\n]*+ # Optional whtiespace ( # Optional Title (?<title>['"]) (.*?) @@ -1134,9 +1956,9 @@ contexts: - include: link-inline - include: link-inet - include: link-email - - include: image-ref - - include: link-ref-literal - - include: link-ref + - include: image-reference + - include: link-reference-literal + - include: link-reference line-break: - match: " {2,}$" scope: meta.dummy.line-break @@ -1157,17 +1979,16 @@ contexts: link-inline: - match: |- (?x: - (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) - # Match the link text. - ([ ])? # Space not allowed - (\() # Opening paren for url - (<?)(.*?)(>?) # The url - [ \t]* # Optional whitespace + (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>+\])+?)(\]) + # Match the link text. + (\() # Opening paren for url + (<?)(.*?)(>?) # The url + [^\S\n]* # Optional whitespace (?: ((\().+?(\))) # Match title in parens… - | ((").+?(")) # or in quotes. - )? # Title is optional - \s* # Optional whitespace + | ((").+?(")) # or in quotes. + )? # Title is optional + \s* # Optional whitespace (\)) ) scope: meta.link.inline.markdown @@ -1175,20 +1996,19 @@ contexts: 1: punctuation.definition.string.begin.markdown 2: string.other.link.title.markdown 4: punctuation.definition.string.end.markdown - 5: invalid.illegal.whitespace.markdown - 6: punctuation.definition.metadata.markdown - 7: punctuation.definition.link.markdown - 8: markup.underline.link.markdown - 9: punctuation.definition.link.markdown - 10: string.other.link.description.title.markdown - 11: punctuation.definition.string.begin.markdown - 12: punctuation.definition.string.end.markdown - 13: string.other.link.description.title.markdown - 14: punctuation.definition.string.begin.markdown - 15: punctuation.definition.string.end.markdown - 16: punctuation.definition.metadata.markdown - link-ref: - - match: '(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)([^\]]*+)(\])' + 5: punctuation.definition.metadata.markdown + 6: punctuation.definition.link.markdown + 7: markup.underline.link.markdown + 8: punctuation.definition.link.markdown + 9: string.other.link.description.title.markdown + 10: punctuation.definition.string.begin.markdown + 11: punctuation.definition.string.end.markdown + 12: string.other.link.description.title.markdown + 13: punctuation.definition.string.begin.markdown + 14: punctuation.definition.string.end.markdown + 15: punctuation.definition.metadata.markdown + link-reference: + - match: '(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*)(\])(?:(\[)([^\]]*)(\]))?' scope: meta.link.reference.markdown captures: 1: punctuation.definition.string.begin.markdown @@ -1197,8 +2017,8 @@ contexts: 5: punctuation.definition.constant.begin.markdown 6: constant.other.reference.link.markdown 7: punctuation.definition.constant.end.markdown - link-ref-literal: - - match: '(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(\])' + link-reference-literal: + - match: '(\[)((?<square>[^\[\]]\\]|\\.|\[\g<square>*+\])*)(\])(?:(\[)(\]))?' scope: meta.link.reference.literal.markdown captures: 1: punctuation.definition.string.begin.markdown @@ -1225,7 +2045,7 @@ contexts: 1: punctuation.definition.raw.markdown 3: punctuation.definition.raw.markdown separator: - - match: '\G[ ]{,3}([-*_])([ ]{,2}\1){2,}[ \t]*$\n?' + - match: '\G[ ]{,3}([-*_])([ ]{,2}\1){2,}[^\S\n]*$\n?' scope: meta.separator.markdown strike: - match: |- @@ -1252,9 +2072,9 @@ contexts: ) | ( # Inline Link \( # Opening paren - [ \t]*+ # Optional whtiespace + [^\S\n]*+ # Optional whtiespace <?(.*?)>? # URL - [ \t]*+ # Optional whtiespace + [^\S\n]*+ # Optional whtiespace ( # Optional Title (?<title>['"]) (.*?) @@ -1293,15 +2113,15 @@ contexts: - include: link-inline - include: link-inet - include: link-email - - include: image-ref - - include: link-ref-literal - - include: link-ref + - include: image-reference + - include: link-reference-literal + - include: link-reference latex-inline: - match: \\\$ - match: |- (?x) - (\$)(?=\S) + (\$)(?=[^\s\$]) (?= (?: \\\\ diff --git a/Syntaxes/Markdown Extended.tmLanguage b/Syntaxes/Markdown Extended.tmLanguage deleted file mode 100644 index d72b1c1..0000000 --- a/Syntaxes/Markdown Extended.tmLanguage +++ /dev/null @@ -1,2887 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>fileTypes</key> - <array> - <string>mdown</string> - <string>markdown</string> - <string>markdn</string> - <string>md.hbs</string> - <string>md</string> - </array> - <key>foldingStartMarker</key> - <string>(?x) -(<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\b.*?> -|<!--(?!.*-->) -|\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/))) -)</string> - <key>foldingStopMarker</key> - <string>(?x) -(</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)> -|^\s*--> -|(^|\s)\} -)</string> - <key>keyEquivalent</key> - <string>^~M</string> - <key>name</key> - <string>Markdown Extended</string> - <key>patterns</key> - <array> - <dict> - <key>begin</key> - <string>(?<!\s)---\n$</string> - <key>end</key> - <string>^---\s</string> - <key>name</key> - <string>markup.raw.yaml.front-matter</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.yaml</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(?<!\s)---\s*coffee\n$</string> - <key>end</key> - <string>^---\s</string> - <key>name</key> - <string>markup.raw.coffee.front-matter</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.coffee</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(?<!\s)---\s*json\n$</string> - <key>end</key> - <string>^---\s</string> - <key>name</key> - <string>markup.raw.json.front-matter</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.json</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(?x)^ -(?= [ ]{,3}>. -| ([ ]{4}|\t)(?!$) -| [#]{1,6}\s*+ -| [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ -)</string> - <key>comment</key> - <string> - We could also use an empty end match and set - applyEndPatternLast, but then we must be sure that the begin - pattern will only match stuff matched by the sub-patterns. - </string> - <key>end</key> - <string>(?x)^ -(?! [ ]{,3}>. -| ([ ]{4}|\t) -| [#]{1,6}\s*+ -| [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ -)</string> - <key>name</key> - <string>meta.block-level.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>#block_quote</string> - </dict> - <dict> - <key>include</key> - <string>#block_raw</string> - </dict> - <dict> - <key>include</key> - <string>#heading</string> - </dict> - <dict> - <key>include</key> - <string>#separator</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(c)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.c</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(cpp)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.c++</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(coffee|coffeescript)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.coffee</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(jade)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.jade</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(css)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.css</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(csharp)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.cs</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(ejs|underscore|lodash)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.ejs</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(erlang)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.erlang</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(diff)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.diff</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(go|golang)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.go</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(graphql)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.graphql</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(hbs|handlebars|html|html5)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>text.html.basic</string> - </dict> - <dict> - <key>include</key> - <string>text.html.handlebars</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(ini)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.ini</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(java)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.java</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(javascript|js)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.js</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(json)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.json</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|{%\s*highlight)\s*(julia|jl)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.julia</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|{%\s*highlight)\s*(less)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.css.less</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(ls|livescript|LiveScript)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.livescript</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(lua)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.lua</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(md|markdown)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>text.html.markdown</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(nginx)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.nginx</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(swift)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.swift</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(obj(?:ective\-|)c)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.objc</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(obj(?:ective\-|)c\+\+)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.objc++</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(perl)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.perl</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(php)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.php</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(python)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.python</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~)\s*\{?\s*(r)(?:[ \}].*$|\}?$)</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.r</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(ruby)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.ruby</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(rust)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.rust</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(sass)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.sass</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(scala)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.scala</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(scss)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.scss</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(sh|shell|bash)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.shell</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(sql|mysql|ddl|dml)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.sql</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(postgresql|postgres|pgsql)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.pgsql</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(styl)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.stylus</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(swig|liquid)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>text.html.swig</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(xml)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>text.xml</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(yaml)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>source.yaml</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(```|~~~|{%\s*highlight)\s*(\w*)\s*((?:linenos\s*)?%})?$</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>variable.language.fenced.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.fenced.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(```|~~~|{%\s*endhighlight\s*%})\n</string> - <key>name</key> - <string>markup.raw.block.markdown markup.raw.block.fenced.markdown</string> - </dict> - <dict> - <key>begin</key> - <string>^[ ]{0,3}([*+-])(?=\s)</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.list_item.markdown</string> - </dict> - </dict> - <key>end</key> - <string>^(?=\S)</string> - <key>name</key> - <string>markup.list.unnumbered.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>#list-paragraph</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>^[ ]{0,3}([0-9]+)(\.)(?=\s)</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.list_item.markdown punctuation.definition.list_item.number.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>punctuation.definition.list_item.markdown</string> - </dict> - </dict> - <key>end</key> - <string>^(?=\S)</string> - <key>name</key> - <string>markup.list.numbered.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>#list-paragraph</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)(?!.*?</\1>)</string> - <key>comment</key> - <string> - Markdown formatting is disabled inside block-level tags. - </string> - <key>end</key> - <string>(?<=^</\1>$\n)</string> - <key>name</key> - <string>meta.disable-markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>text.html.basic</string> - </dict> - <dict> - <key>include</key> - <string>text.html.handlebars</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)</string> - <key>comment</key> - <string>Same rule but for one line disables.</string> - <key>end</key> - <string>$\n?</string> - <key>name</key> - <string>meta.disable-markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>text.html.basic</string> - </dict> - <dict> - <key>include</key> - <string>text.html.handlebars</string> - </dict> - </array> - </dict> - <dict> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.constant.markdown</string> - </dict> - <key>10</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.end.markdown</string> - </dict> - <key>11</key> - <dict> - <key>name</key> - <string>string.other.link.description.title.markdown</string> - </dict> - <key>12</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.begin.markdown</string> - </dict> - <key>13</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.end.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>constant.other.reference.link.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.constant.markdown</string> - </dict> - <key>4</key> - <dict> - <key>name</key> - <string>punctuation.separator.key-value.markdown</string> - </dict> - <key>5</key> - <dict> - <key>name</key> - <string>punctuation.definition.link.markdown</string> - </dict> - <key>6</key> - <dict> - <key>name</key> - <string>markup.underline.link.markdown</string> - </dict> - <key>7</key> - <dict> - <key>name</key> - <string>punctuation.definition.link.markdown</string> - </dict> - <key>8</key> - <dict> - <key>name</key> - <string>string.other.link.description.title.markdown</string> - </dict> - <key>9</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.begin.markdown</string> - </dict> - </dict> - <key>match</key> - <string>(?x: - \s* # Leading whitespace - (\[)(.+?)(\])(:) # Reference name - [ \t]* # Optional whitespace - (<?)(\S+?)(>?) # The url - [ \t]* # Optional whitespace - (?: - ((\().+?(\))) # Match title in quotes… - | ((").+?(")) # or in parens. - )? # Title is optional - \s* # Optional whitespace - $ - )</string> - <key>name</key> - <string>meta.link.reference.def.markdown</string> - </dict> - <dict> - <key>begin</key> - <string>^(?=\S)(?![=-]{3,}(?=$))</string> - <key>end</key> - <string>^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ \t]*\n|(?=^#)</string> - <key>name</key> - <string>meta.paragraph.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>#inline</string> - </dict> - <dict> - <key>include</key> - <string>text.html.handlebars</string> - </dict> - <dict> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.heading.markdown</string> - </dict> - </dict> - <key>match</key> - <string>^(={3,})(?=[ \t]*$)</string> - <key>name</key> - <string>markup.heading.1.markdown</string> - </dict> - <dict> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.heading.markdown</string> - </dict> - </dict> - <key>match</key> - <string>^(-{3,})(?=[ \t]*$)</string> - <key>name</key> - <string>markup.heading.2.markdown</string> - </dict> - </array> - </dict> - </array> - <key>repository</key> - <dict> - <key>ampersand</key> - <dict> - <key>comment</key> - <string> - Markdown will convert this for us. We match it so that the - HTML grammar will not mark it up as invalid. - </string> - <key>match</key> - <string>&(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)</string> - <key>name</key> - <string>meta.other.valid-ampersand.markdown</string> - </dict> - <key>block_quote</key> - <dict> - <key>begin</key> - <string>\G[ ]{,3}(>)(?!$)[ ]?</string> - <key>beginCaptures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.blockquote.markdown</string> - </dict> - </dict> - <key>comment</key> - <string> - We terminate the block quote when seeing an empty line, a - separator or a line with leading > characters. The latter is - to “reset” the quote level for quoted lines. - </string> - <key>end</key> - <string>(?x)^ -(?= \s*$ -| [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ -| [ ]{,3}>. -)</string> - <key>name</key> - <string>markup.quote.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>begin</key> - <string>(?x)\G -(?= [ ]{,3}>. -)</string> - <key>end</key> - <string>^</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>#block_quote</string> - </dict> - </array> - </dict> - <dict> - <key>applyEndPatternLast</key> - <integer>1</integer> - <key>begin</key> - <string>(?x)\G -(?= ([ ]{4}|\t) -| [#]{1,6}\s*+ -| [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ -)</string> - <key>end</key> - <string>^</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>#block_raw</string> - </dict> - <dict> - <key>include</key> - <string>#heading</string> - </dict> - <dict> - <key>include</key> - <string>#separator</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>(?x)\G -(?! $ -| [ ]{,3}>. -| ([ ]{4}|\t) -| [#]{1,6}\s*+ -| [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ -)</string> - <key>end</key> - <string>$|(?<=\n)</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>#inline</string> - </dict> - </array> - </dict> - </array> - </dict> - <key>block_raw</key> - <dict> - <key>match</key> - <string>\G([ ]{4}|\t).*$\n?</string> - <key>name</key> - <string>markup.raw.block.markdown</string> - </dict> - <key>bold</key> - <dict> - <key>begin</key> - <string>(?x) -(\*\*|__)(?=\S) # Open -(?= - ( - <[^>]*+> # HTML tags - | (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> - # Raw - | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes - | \[ - ( - (?<square> # Named group - [^\[\]\\] # Match most chars - | \\. # Escaped chars - | \[ \g<square>*+ \] # Nested brackets - )*+ - \] - ( - ( # Reference Link - [ ]? # Optional space - \[[^\]]*+\] # Ref name - ) - | ( # Inline Link - \( # Opening paren - [ \t]*+ # Optional whtiespace - <?(.*?)>? # URL - [ \t]*+ # Optional whtiespace - ( # Optional Title - (?<title>['"]) - (.*?) - \k<title> - )? - \) - ) - ) - ) - | (?!(?<=\S)\1). # Everything besides - # style closer - )++ - (?<=\S)\1 # Close -)</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.bold.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(?<=\S)(\1)</string> - <key>name</key> - <string>markup.bold.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>applyEndPatternLast</key> - <integer>1</integer> - <key>begin</key> - <string>(?=<[^>]*?>)</string> - <key>end</key> - <string>(?<=>)</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>text.html.handlebars</string> - </dict> - </array> - </dict> - <dict> - <key>include</key> - <string>#escape</string> - </dict> - <dict> - <key>include</key> - <string>#ampersand</string> - </dict> - <dict> - <key>include</key> - <string>#bracket</string> - </dict> - <dict> - <key>include</key> - <string>#raw</string> - </dict> - <dict> - <key>include</key> - <string>#italic</string> - </dict> - <dict> - <key>include</key> - <string>#strike</string> - </dict> - <dict> - <key>include</key> - <string>#image-inline</string> - </dict> - <dict> - <key>include</key> - <string>#link-inline</string> - </dict> - <dict> - <key>include</key> - <string>#link-inet</string> - </dict> - <dict> - <key>include</key> - <string>#link-email</string> - </dict> - <dict> - <key>include</key> - <string>#image-ref</string> - </dict> - <dict> - <key>include</key> - <string>#link-ref-literal</string> - </dict> - <dict> - <key>include</key> - <string>#link-ref</string> - </dict> - </array> - </dict> - <key>bracket</key> - <dict> - <key>comment</key> - <string> - Markdown will convert this for us. We match it so that the - HTML grammar will not mark it up as invalid. - </string> - <key>match</key> - <string><(?![a-z/?\$!])</string> - <key>name</key> - <string>meta.other.valid-bracket.markdown</string> - </dict> - <key>escape</key> - <dict> - <key>match</key> - <string>\\[-`*_#+.!(){}\[\]\\>]</string> - <key>name</key> - <string>constant.character.escape.markdown</string> - </dict> - <key>heading</key> - <dict> - <key>patterns</key> - <array> - <dict> - <key>begin</key> - <string>\G(#{1})(?!#)\s*(?=\S)</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.heading.markdown</string> - </dict> - </dict> - <key>contentName</key> - <string>markup.heading.1.markdown</string> - <key>end</key> - <string>\s*(#*)$\n?</string> - <key>name</key> - <string>markup.heading.1.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>#inline</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>\G(#{2})(?!#)\s*(?=\S)</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.heading.markdown</string> - </dict> - </dict> - <key>contentName</key> - <string>markup.heading.2.markdown</string> - <key>end</key> - <string>\s*(#*)$\n?</string> - <key>name</key> - <string>markup.heading.2.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>#inline</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>\G(#{3})(?!#)\s*(?=\S)</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.heading.markdown</string> - </dict> - </dict> - <key>contentName</key> - <string>markup.heading.3.markdown</string> - <key>end</key> - <string>\s*(#*)$\n?</string> - <key>name</key> - <string>markup.heading.3.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>#inline</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>\G(#{4})(?!#)\s*(?=\S)</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.heading.markdown</string> - </dict> - </dict> - <key>contentName</key> - <string>markup.heading.4.markdown</string> - <key>end</key> - <string>\s*(#*)$\n?</string> - <key>name</key> - <string>markup.heading.4.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>#inline</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>\G(#{5})(?!#)\s*(?=\S)</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.heading.markdown</string> - </dict> - </dict> - <key>contentName</key> - <string>markup.heading.5.markdown</string> - <key>end</key> - <string>\s*(#*)$\n?</string> - <key>name</key> - <string>markup.heading.5.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>#inline</string> - </dict> - </array> - </dict> - <dict> - <key>begin</key> - <string>\G(#{6})(?!#)\s*(?=\S)</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.heading.markdown</string> - </dict> - </dict> - <key>contentName</key> - <string>markup.heading.6.markdown</string> - <key>end</key> - <string>\s*(#*)$\n?</string> - <key>name</key> - <string>markup.heading.6.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>#inline</string> - </dict> - </array> - </dict> - </array> - </dict> - <key>image-inline</key> - <dict> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.begin.markdown</string> - </dict> - <key>10</key> - <dict> - <key>name</key> - <string>string.other.link.description.title.markdown</string> - </dict> - <key>11</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.markdown</string> - </dict> - <key>12</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.markdown</string> - </dict> - <key>13</key> - <dict> - <key>name</key> - <string>string.other.link.description.title.markdown</string> - </dict> - <key>14</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.markdown</string> - </dict> - <key>15</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.markdown</string> - </dict> - <key>16</key> - <dict> - <key>name</key> - <string>punctuation.definition.metadata.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>string.other.link.description.markdown</string> - </dict> - <key>4</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.end.markdown</string> - </dict> - <key>5</key> - <dict> - <key>name</key> - <string>invalid.illegal.whitespace.markdown</string> - </dict> - <key>6</key> - <dict> - <key>name</key> - <string>punctuation.definition.metadata.markdown</string> - </dict> - <key>7</key> - <dict> - <key>name</key> - <string>punctuation.definition.link.markdown</string> - </dict> - <key>8</key> - <dict> - <key>name</key> - <string>markup.underline.link.image.markdown</string> - </dict> - <key>9</key> - <dict> - <key>name</key> - <string>punctuation.definition.link.markdown</string> - </dict> - </dict> - <key>match</key> - <string>(?x: - \! # Images start with ! - (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) - # Match the link text. - ([ ])? # Space not allowed - (\() # Opening paren for url - (<?)(\S+?)(>?) # The url - [ \t]* # Optional whitespace - (?: - ((\().+?(\))) # Match title in parens… - | ((").+?(")) # or in quotes. - )? # Title is optional - \s* # Optional whitespace - (\)) - )</string> - <key>name</key> - <string>meta.image.inline.markdown</string> - </dict> - <key>image-ref</key> - <dict> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.begin.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>string.other.link.description.markdown</string> - </dict> - <key>4</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.begin.markdown</string> - </dict> - <key>5</key> - <dict> - <key>name</key> - <string>punctuation.definition.constant.markdown</string> - </dict> - <key>6</key> - <dict> - <key>name</key> - <string>constant.other.reference.link.markdown</string> - </dict> - <key>7</key> - <dict> - <key>name</key> - <string>punctuation.definition.constant.markdown</string> - </dict> - </dict> - <key>match</key> - <string>\!(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(.*?)(\])</string> - <key>name</key> - <string>meta.image.reference.markdown</string> - </dict> - <key>inline</key> - <dict> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>#escape</string> - </dict> - <dict> - <key>include</key> - <string>#ampersand</string> - </dict> - <dict> - <key>include</key> - <string>#bracket</string> - </dict> - <dict> - <key>include</key> - <string>#raw</string> - </dict> - <dict> - <key>include</key> - <string>#bold</string> - </dict> - <dict> - <key>include</key> - <string>#italic</string> - </dict> - <dict> - <key>include</key> - <string>#strike</string> - </dict> - <dict> - <key>include</key> - <string>#line-break</string> - </dict> - <dict> - <key>include</key> - <string>#image-inline</string> - </dict> - <dict> - <key>include</key> - <string>#link-inline</string> - </dict> - <dict> - <key>include</key> - <string>#link-inet</string> - </dict> - <dict> - <key>include</key> - <string>#link-email</string> - </dict> - <dict> - <key>include</key> - <string>#image-ref</string> - </dict> - <dict> - <key>include</key> - <string>#link-ref-literal</string> - </dict> - <dict> - <key>include</key> - <string>#link-ref</string> - </dict> - </array> - </dict> - <key>italic</key> - <dict> - <key>begin</key> - <string>(?x) -(\*|_)(?=\S) # Open -(?= - ( - <[^>]*+> # HTML tags - | (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> - # Raw - | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes - | \[ - ( - (?<square> # Named group - [^\[\]\\] # Match most chars - | \\. # Escaped chars - | \[ \g<square>*+ \] # Nested brackets - )*+ - \] - ( - ( # Reference Link - [ ]? # Optional space - \[[^\]]*+\] # Ref name - ) - | ( # Inline Link - \( # Opening paren - [ \t]*+ # Optional whtiespace - <?(.*?)>? # URL - [ \t]*+ # Optional whtiespace - ( # Optional Title - (?<title>['"]) - (.*?) - \k<title> - )? - \) - ) - ) - ) - | \1\1 # Must be bold closer - | (?!(?<=\S)\1). # Everything besides - # style closer - )++ - (?<=\S)\1 # Close -)</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.italic.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(?<=\S)(\1)((?!\1)|(?=\1\1))</string> - <key>name</key> - <string>markup.italic.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>applyEndPatternLast</key> - <integer>1</integer> - <key>begin</key> - <string>(?=<[^>]*?>)</string> - <key>end</key> - <string>(?<=>)</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>text.html.handlebars</string> - </dict> - </array> - </dict> - <dict> - <key>include</key> - <string>#escape</string> - </dict> - <dict> - <key>include</key> - <string>#ampersand</string> - </dict> - <dict> - <key>include</key> - <string>#bracket</string> - </dict> - <dict> - <key>include</key> - <string>#raw</string> - </dict> - <dict> - <key>include</key> - <string>#bold</string> - </dict> - <dict> - <key>include</key> - <string>#strike</string> - </dict> - <dict> - <key>include</key> - <string>#image-inline</string> - </dict> - <dict> - <key>include</key> - <string>#link-inline</string> - </dict> - <dict> - <key>include</key> - <string>#link-inet</string> - </dict> - <dict> - <key>include</key> - <string>#link-email</string> - </dict> - <dict> - <key>include</key> - <string>#image-ref</string> - </dict> - <dict> - <key>include</key> - <string>#link-ref-literal</string> - </dict> - <dict> - <key>include</key> - <string>#link-ref</string> - </dict> - </array> - </dict> - <key>line-break</key> - <dict> - <key>match</key> - <string> {2,}$</string> - <key>name</key> - <string>meta.dummy.line-break</string> - </dict> - <key>link-email</key> - <dict> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.link.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>markup.underline.link.markdown</string> - </dict> - <key>4</key> - <dict> - <key>name</key> - <string>punctuation.definition.link.markdown</string> - </dict> - </dict> - <key>match</key> - <string>(<)((?:mailto:)?[-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(>)</string> - <key>name</key> - <string>meta.link.email.lt-gt.markdown</string> - </dict> - <key>link-inet</key> - <dict> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.link.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>markup.underline.link.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.link.markdown</string> - </dict> - </dict> - <key>match</key> - <string>(<)((?:https?|ftp)://.*?)(>)</string> - <key>name</key> - <string>meta.link.inet.markdown</string> - </dict> - <key>link-inline</key> - <dict> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.begin.markdown</string> - </dict> - <key>10</key> - <dict> - <key>name</key> - <string>string.other.link.description.title.markdown</string> - </dict> - <key>11</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.begin.markdown</string> - </dict> - <key>12</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.end.markdown</string> - </dict> - <key>13</key> - <dict> - <key>name</key> - <string>string.other.link.description.title.markdown</string> - </dict> - <key>14</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.begin.markdown</string> - </dict> - <key>15</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.end.markdown</string> - </dict> - <key>16</key> - <dict> - <key>name</key> - <string>punctuation.definition.metadata.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>string.other.link.title.markdown</string> - </dict> - <key>4</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.end.markdown</string> - </dict> - <key>5</key> - <dict> - <key>name</key> - <string>invalid.illegal.whitespace.markdown</string> - </dict> - <key>6</key> - <dict> - <key>name</key> - <string>punctuation.definition.metadata.markdown</string> - </dict> - <key>7</key> - <dict> - <key>name</key> - <string>punctuation.definition.link.markdown</string> - </dict> - <key>8</key> - <dict> - <key>name</key> - <string>markup.underline.link.markdown</string> - </dict> - <key>9</key> - <dict> - <key>name</key> - <string>punctuation.definition.link.markdown</string> - </dict> - </dict> - <key>match</key> - <string>(?x: - (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) - # Match the link text. - ([ ])? # Space not allowed - (\() # Opening paren for url - (<?)(.*?)(>?) # The url - [ \t]* # Optional whitespace - (?: - ((\().+?(\))) # Match title in parens… - | ((").+?(")) # or in quotes. - )? # Title is optional - \s* # Optional whitespace - (\)) - )</string> - <key>name</key> - <string>meta.link.inline.markdown</string> - </dict> - <key>link-ref</key> - <dict> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.begin.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>string.other.link.title.markdown</string> - </dict> - <key>4</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.end.markdown</string> - </dict> - <key>5</key> - <dict> - <key>name</key> - <string>punctuation.definition.constant.begin.markdown</string> - </dict> - <key>6</key> - <dict> - <key>name</key> - <string>constant.other.reference.link.markdown</string> - </dict> - <key>7</key> - <dict> - <key>name</key> - <string>punctuation.definition.constant.end.markdown</string> - </dict> - </dict> - <key>match</key> - <string>(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)([^\]]*+)(\])</string> - <key>name</key> - <string>meta.link.reference.markdown</string> - </dict> - <key>link-ref-literal</key> - <dict> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.begin.markdown</string> - </dict> - <key>2</key> - <dict> - <key>name</key> - <string>string.other.link.title.markdown</string> - </dict> - <key>4</key> - <dict> - <key>name</key> - <string>punctuation.definition.string.end.markdown</string> - </dict> - <key>5</key> - <dict> - <key>name</key> - <string>punctuation.definition.constant.begin.markdown</string> - </dict> - <key>6</key> - <dict> - <key>name</key> - <string>punctuation.definition.constant.end.markdown</string> - </dict> - </dict> - <key>match</key> - <string>(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(\])</string> - <key>name</key> - <string>meta.link.reference.literal.markdown</string> - </dict> - <key>list-paragraph</key> - <dict> - <key>patterns</key> - <array> - <dict> - <key>begin</key> - <string>\G\s+(?=\S)</string> - <key>end</key> - <string>^\s*$</string> - <key>name</key> - <string>meta.paragraph.list.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>#inline</string> - </dict> - </array> - </dict> - </array> - </dict> - <key>raw</key> - <dict> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.raw.markdown</string> - </dict> - <key>3</key> - <dict> - <key>name</key> - <string>punctuation.definition.raw.markdown</string> - </dict> - </dict> - <key>match</key> - <string>(`+)([^`]|(?!(?<!`)\1(?!`))`)*+(\1)</string> - <key>name</key> - <string>markup.raw.inline.markdown</string> - </dict> - <key>separator</key> - <dict> - <key>match</key> - <string>\G[ ]{,3}([-*_])([ ]{,2}\1){2,}[ \t]*$\n?</string> - <key>name</key> - <string>meta.separator.markdown</string> - </dict> - <key>strike</key> - <dict> - <key>begin</key> - <string>(?x) -(~~)(?=\S) # Open -(?= - ( - <[^>]*+> # HTML tags - | (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> - # Raw - | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes - | \[ - ( - (?<square> # Named group - [^\[\]\\] # Match most chars - | \\. # Escaped chars - | \[ \g<square>*+ \] # Nested brackets - )*+ - \] - ( - ( # Reference Link - [ ]? # Optional space - \[[^\]]*+\] # Ref name - ) - | ( # Inline Link - \( # Opening paren - [ \t]*+ # Optional whtiespace - <?(.*?)>? # URL - [ \t]*+ # Optional whtiespace - ( # Optional Title - (?<title>['"]) - (.*?) - \k<title> - )? - \) - ) - ) - ) - | \1\1 # Must be bold closer - | (?!(?<=\S)\1). # Everything besides - # style closer - )++ - (?<=\S)\1 # Close -)</string> - <key>captures</key> - <dict> - <key>1</key> - <dict> - <key>name</key> - <string>punctuation.definition.strike.markdown</string> - </dict> - </dict> - <key>end</key> - <string>(?<=\S)(\1)((?!\1)|(?=\1\1))</string> - <key>name</key> - <string>markup.strike.markdown</string> - <key>patterns</key> - <array> - <dict> - <key>applyEndPatternLast</key> - <integer>1</integer> - <key>begin</key> - <string>(?=<[^>]*?>)</string> - <key>end</key> - <string>(?<=>)</string> - <key>patterns</key> - <array> - <dict> - <key>include</key> - <string>text.html.handlebars</string> - </dict> - </array> - </dict> - <dict> - <key>include</key> - <string>#escape</string> - </dict> - <dict> - <key>include</key> - <string>#ampersand</string> - </dict> - <dict> - <key>include</key> - <string>#bracket</string> - </dict> - <dict> - <key>include</key> - <string>#raw</string> - </dict> - <dict> - <key>include</key> - <string>#bold</string> - </dict> - <dict> - <key>include</key> - <string>#italic</string> - </dict> - <dict> - <key>include</key> - <string>#image-inline</string> - </dict> - <dict> - <key>include</key> - <string>#link-inline</string> - </dict> - <dict> - <key>include</key> - <string>#link-inet</string> - </dict> - <dict> - <key>include</key> - <string>#link-email</string> - </dict> - <dict> - <key>include</key> - <string>#image-ref</string> - </dict> - <dict> - <key>include</key> - <string>#link-ref-literal</string> - </dict> - <dict> - <key>include</key> - <string>#link-ref</string> - </dict> - </array> - </dict> - </dict> - <key>scopeName</key> - <string>text.html.markdown</string> - <key>uuid</key> - <string>dd477cf1-34c4-49d2-ba09-f8445676ccd4</string> -</dict> -</plist> diff --git a/build/data/context.js b/build/data/context.js new file mode 100644 index 0000000..e681f4f --- /dev/null +++ b/build/data/context.js @@ -0,0 +1,179 @@ +module.exports = { + definitions: [ + { name: 'applescript', lang: 'applescript', scope: 'source.applescript'}, + { name: 'asp', lang: 'asp', scope: 'source.asp' }, + { name: 'bash', lang: 'bash|sh|shell', scope: 'source.shell' }, + { name: 'bibtex', lang: 'bibtex', scope: 'text.bibtex' }, + { name: 'c', lang: 'c', scope: 'source.c' }, + { name: 'clojure', lang: 'clojure', scope: 'source.clojure' }, + { name: 'cmake', lang: 'cmake', scope: 'source.cmake' }, + { name: 'coffee', lang: 'coffee|coffeescript', scope: 'source.coffee' }, + { name: 'cpp', lang: 'cpp', scope: 'source.c++' }, + { name: 'csharp', lang: 'csharp', scope: 'source.cs' }, + { name: 'css', lang: 'css', scope: 'source.css' }, + { name: 'd', lang: 'd', scope: 'source.d' }, + { name: 'ddl', lang: 'ddl|dml|mysql|sql', scope: 'source.sql' }, + { name: 'diff', lang: 'diff', scope: 'source.diff' }, + { name: 'dockerfile', lang: 'dockerfile', scope: 'source.dockerfile'}, + { name: 'dosbatch', lang: 'dosbatch', scope: 'source.dosbatch' }, + { name: 'dot', lang: 'dot', scope: 'source.dot' }, + { name: 'editorconfig', lang: 'editorconfig', scope: 'source.ini.editorconfig'}, + { name: 'ejs', lang: 'ejs|lodash|underscore', scope: 'source.ejs'}, + { name: 'erb', lang: 'erb|html\\+ruby|rails', scope: 'text.html.ruby'}, + { name: 'erlang', lang: 'erlang', scope: 'source.erlang' }, + { name: 'git', lang: 'git', scope: 'source.git' }, + { name: 'go', lang: 'go|golang', scope: 'source.go' }, + { name: 'gradle', lang: 'gradle', scope: 'source.gradle' }, + { name: 'graphql', lang: 'graphql', scope: 'source.graphql' }, + { name: 'groovy', lang: 'groovy', scope: 'source.groovy' }, + { name: 'gruntfile.coffee', lang: 'gruntfile\\.coffee', scope: 'source.gruntfile.coffee'}, + { name: 'gruntfile.js', lang: 'gruntfile\\.js', scope: 'source.gruntfile.js'}, + { name: 'gulpfile.coffee', lang: 'gulpfile\\.coffee', scope: 'source.gulpfile.coffee'}, + { name: 'gulpfile.js', lang: 'gulpfile\\.js', scope: 'source.gulpfile.js'}, + { name: 'haml', lang: 'haml', scope: 'text.haml' }, + { name: + 'handlebars', + lang: 'handlebars|hbs|html|html5', + scope: 'text.html.basic', + append: ' - include: scope:text.html.handlebars' + }, + { name: 'haskell', lang: 'haskell', scope: 'source.haskell' }, + { name: 'ini', lang: 'ini', scope: 'source.ini' }, + { name: 'jade', lang: 'jade', scope: 'source.jade' }, + { name: 'java', lang: 'java', scope: 'source.java' }, + { name: 'javadoc', lang: 'javadoc', scope: 'text.html.javadoc' }, + { name: 'jl', lang: 'jl|julia', scope: 'source.julia' }, + { name: 'json', lang: 'json', scope: 'source.json' }, + { name: 'jsx', lang: 'jsx', scope: 'source.jsx' }, + { name: 'latex', lang: 'latex', scope: 'text.tex.latex' }, + { name: 'less', lang: 'less', scope: 'source.less' }, + { name: 'liquid', lang: 'liquid|swig', scope: 'text.html.swig' }, + { name: 'LiveScript', lang: 'LiveScript|livescript|ls', scope: 'source.livescript'}, + { name: 'lua', lang: 'lua', scope: 'source.lua' }, + { name: 'makefile', lang: 'makefile', scope: 'source.makefile' }, + { name: 'markdown', lang: 'markdown|md', scope: 'text.html.multimarkdown'}, + { name: 'math', lang: 'math', scope: 'text.tex.math' }, + { name: 'matlab', lang: 'matlab', scope: 'source.matlab' }, + { name: 'mustache', lang: 'mustache', scope: 'text.html.mustache'}, + { name: 'nginx', lang: 'nginx', scope: 'source.nginx' }, + { name: 'objc', lang: 'objc|objective-c', scope: 'source.objc' }, + { name: 'objc++', lang: 'objc\\+\\+|objective-c\\+\\+', scope: 'source.objc++'}, + { name: 'ocaml', lang: 'ocaml', scope: 'source.ocaml' }, + { name: 'ocamllex', lang: 'ocamllex', scope: 'source.ocamllex' }, + { name: 'ocamlyacc', lang: 'ocamlyacc', scope: 'source.ocamlyacc'}, + { name: 'pascal', lang: 'pascal', scope: 'source.pascal' }, + { name: 'perl', lang: 'perl', scope: 'source.perl' }, + { name: 'pgsql', lang: 'pgsql|postgres|postgresql', scope: 'source.pgsql'}, + { name: 'php', lang: 'php', scope: 'source.php' }, + { name: 'plain', lang: 'plain', scope: 'text.plain' }, + { name: 'procfile', lang: 'procfile', scope: 'source.procfile' }, + { name: 'puppet', lang: 'puppet', scope: 'source.puppet' }, + { name: 'python', lang: 'python', scope: 'source.python' }, + { name: 'regexp', lang: 'regexp', scope: 'source.regexp' }, + { name: 'regexp.pyjade', lang: 'regexp\\.pyjade', scope: 'source.pyjade'}, + { name: 'regexp.python', lang: 'regexp\\.python', scope: 'source.regexp.python'}, + { name: 'ruby', lang: 'ruby', scope: 'source.ruby' }, + { name: 'rust', lang: 'rust', scope: 'source.rust' }, + { name: 'sass', lang: 'sass', scope: 'source.sass' }, + { name: 'scala', lang: 'scala', scope: 'source.scala' }, + { name: 'scss', lang: 'scss', scope: 'source.scss' }, + { name: 'styl', lang: 'styl', scope: 'source.stylus' }, + { name: 'swift', lang: 'swift', scope: 'source.swift' }, + { name: 'tex', lang: 'tex', scope: 'text.tex' }, + { name: 'textile', lang: 'textile', scope: 'text.html.textile' }, + { name: 'todo', lang: 'todo', scope: 'text.todo' }, + { name: 'twig', lang: 'twig', scope: 'text.html.twig' }, + { name: 'xml', lang: 'xml', scope: 'text.xml' }, + { name: 'yaml', lang: 'yaml', scope: 'source.yaml' } + ], + langs: [ + 'LiveScript|livescript|ls', + 'bash|sh|shell', + 'c', + 'coffee|coffeescript', + 'cpp', + 'csharp', + 'css', + 'ddl|dml|mysql|sql', + 'diff', + 'editorconfig', + 'ejs|lodash|underscore', + 'erb|html\\+ruby|rails', + 'erlang', + 'go|golang', + 'graphql', + 'handlebars|hbs|html|html5', + 'ini', + 'jade', + 'java', + 'javascript|js', + 'jl|julia', + 'json', + 'jsx', + 'less', + 'liquid|swig', + 'lua', + 'markdown|md', + 'nginx', + 'objc\\+\\+|objective-c\\+\\+', + 'objc|objective-c', + 'perl', + 'pgsql|postgres|postgresql', + 'php', + 'python', + 'ruby', + 'rust', + 'sass', + 'scala', + 'scss', + 'styl', + 'swift', + 'xml', + 'yaml' + ], + scopes: [ + 'source.c', + 'source.c++', + 'source.coffee', + 'source.cs', + 'source.css', + 'source.diff', + 'source.ejs', + 'source.erlang', + 'source.go', + 'source.graphql', + 'source.ini', + 'source.ini.editorconfig', + 'source.jade', + 'source.java', + 'source.js', + 'source.json', + 'source.jsx', + 'source.julia', + 'source.less', + 'source.livescript', + 'source.lua', + 'source.nginx', + 'source.objc', + 'source.objc++', + 'source.perl', + 'source.pgsql', + 'source.php', + 'source.python', + 'source.ruby', + 'source.rust', + 'source.sass', + 'source.scala', + 'source.scss', + 'source.shell', + 'source.sql', + 'source.stylus', + 'source.swift', + 'source.yaml', + 'text.html.basic', + 'text.html.multimarkdown', + 'text.html.ruby', + 'text.html.swig', + 'text.xml' + ] +}; diff --git a/build/output/fences.yaml b/build/output/fences.yaml new file mode 100644 index 0000000..b6c3f01 --- /dev/null +++ b/build/output/fences.yaml @@ -0,0 +1,1394 @@ + + # fenced markdown: applescript + - match: '(```|~~~|{%\s*highlight)\s*(applescript)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.applescript + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.applescript + + # fenced markdown: asp + - match: '(```|~~~|{%\s*highlight)\s*(asp)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.asp + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.asp + + # fenced markdown: bash + - match: '(```|~~~|{%\s*highlight)\s*(bash|sh|shell)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.shell + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.shell + + # fenced markdown: bibtex + - match: '(```|~~~|{%\s*highlight)\s*(bibtex)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.bibtex + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.bibtex + + # fenced markdown: c + - match: '(```|~~~|{%\s*highlight)\s*(c)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.c + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.c + + # fenced markdown: clojure + - match: '(```|~~~|{%\s*highlight)\s*(clojure)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.clojure + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.clojure + + # fenced markdown: cmake + - match: '(```|~~~|{%\s*highlight)\s*(cmake)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.cmake + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.cmake + + # fenced markdown: coffee + - match: '(```|~~~|{%\s*highlight)\s*(coffee|coffeescript)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.coffee + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.coffee + + # fenced markdown: cpp + - match: '(```|~~~|{%\s*highlight)\s*(cpp)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.c++ + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.c++ + + # fenced markdown: csharp + - match: '(```|~~~|{%\s*highlight)\s*(csharp)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.cs + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.cs + + # fenced markdown: css + - match: '(```|~~~|{%\s*highlight)\s*(css)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.css + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.css + + # fenced markdown: d + - match: '(```|~~~|{%\s*highlight)\s*(d)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.d + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.d + + # fenced markdown: ddl + - match: '(```|~~~|{%\s*highlight)\s*(ddl|dml|mysql|sql)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.sql + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.sql + + # fenced markdown: diff + - match: '(```|~~~|{%\s*highlight)\s*(diff)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.diff + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.diff + + # fenced markdown: dockerfile + - match: '(```|~~~|{%\s*highlight)\s*(dockerfile)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.dockerfile + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.dockerfile + + # fenced markdown: dosbatch + - match: '(```|~~~|{%\s*highlight)\s*(dosbatch)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.dosbatch + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.dosbatch + + # fenced markdown: dot + - match: '(```|~~~|{%\s*highlight)\s*(dot)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.dot + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.dot + + # fenced markdown: editorconfig + - match: '(```|~~~|{%\s*highlight)\s*(editorconfig)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.ini.editorconfig + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.ini.editorconfig + + # fenced markdown: ejs + - match: '(```|~~~|{%\s*highlight)\s*(ejs|lodash|underscore)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.ejs + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.ejs + + # fenced markdown: erb + - match: '(```|~~~|{%\s*highlight)\s*(erb|html\+ruby|rails)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.html.ruby + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.html.ruby + + # fenced markdown: erlang + - match: '(```|~~~|{%\s*highlight)\s*(erlang)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.erlang + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.erlang + + # fenced markdown: git + - match: '(```|~~~|{%\s*highlight)\s*(git)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.git + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.git + + # fenced markdown: go + - match: '(```|~~~|{%\s*highlight)\s*(go|golang)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.go + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.go + + # fenced markdown: gradle + - match: '(```|~~~|{%\s*highlight)\s*(gradle)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.gradle + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.gradle + + # fenced markdown: graphql + - match: '(```|~~~|{%\s*highlight)\s*(graphql)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.graphql + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.graphql + + # fenced markdown: groovy + - match: '(```|~~~|{%\s*highlight)\s*(groovy)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.groovy + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.groovy + + # fenced markdown: gruntfile.coffee + - match: '(```|~~~|{%\s*highlight)\s*(gruntfile\.coffee)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.gruntfile.coffee + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.gruntfile.coffee + + # fenced markdown: gruntfile.js + - match: '(```|~~~|{%\s*highlight)\s*(gruntfile\.js)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.gruntfile.js + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.gruntfile.js + + # fenced markdown: gulpfile.coffee + - match: '(```|~~~|{%\s*highlight)\s*(gulpfile\.coffee)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.gulpfile.coffee + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.gulpfile.coffee + + # fenced markdown: gulpfile.js + - match: '(```|~~~|{%\s*highlight)\s*(gulpfile\.js)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.gulpfile.js + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.gulpfile.js + + # fenced markdown: haml + - match: '(```|~~~|{%\s*highlight)\s*(haml)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.haml + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.haml + + # fenced markdown: handlebars + - match: '(```|~~~|{%\s*highlight)\s*(handlebars|hbs|html|html5)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.html.basic + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.html.basic + + # fenced markdown: haskell + - match: '(```|~~~|{%\s*highlight)\s*(haskell)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.haskell + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.haskell + + # fenced markdown: ini + - match: '(```|~~~|{%\s*highlight)\s*(ini)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.ini + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.ini + + # fenced markdown: jade + - match: '(```|~~~|{%\s*highlight)\s*(jade)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.jade + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.jade + + # fenced markdown: java + - match: '(```|~~~|{%\s*highlight)\s*(java)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.java + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.java + + # fenced markdown: javadoc + - match: '(```|~~~|{%\s*highlight)\s*(javadoc)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.html.javadoc + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.html.javadoc + + # fenced markdown: javascript + - match: '(```|~~~|{%\s*highlight)\s*(javascript|js)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.js + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.js + + # fenced markdown: jl + - match: '(```|~~~|{%\s*highlight)\s*(jl|julia)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.julia + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.julia + + # fenced markdown: json + - match: '(```|~~~|{%\s*highlight)\s*(json)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.json + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.json + + # fenced markdown: jsx + - match: '(```|~~~|{%\s*highlight)\s*(jsx)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.jsx + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.jsx + + # fenced markdown: latex + - match: '(```|~~~|{%\s*highlight)\s*(latex)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.tex.latex + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.tex.latex + + # fenced markdown: less + - match: '(```|~~~|{%\s*highlight)\s*(less)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.less + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.less + + # fenced markdown: liquid + - match: '(```|~~~|{%\s*highlight)\s*(liquid|swig)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.html.swig + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.html.swig + + # fenced markdown: LiveScript + - match: '(```|~~~|{%\s*highlight)\s*(LiveScript|livescript|ls)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.livescript + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.livescript + + # fenced markdown: lua + - match: '(```|~~~|{%\s*highlight)\s*(lua)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.lua + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.lua + + # fenced markdown: makefile + - match: '(```|~~~|{%\s*highlight)\s*(makefile)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.makefile + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.makefile + + # fenced markdown: markdown + - match: '(```|~~~|{%\s*highlight)\s*(markdown|md)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.html.multimarkdown + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.html.multimarkdown + + # fenced markdown: math + - match: '(```|~~~|{%\s*highlight)\s*(math)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.tex.math + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.tex.math + + # fenced markdown: matlab + - match: '(```|~~~|{%\s*highlight)\s*(matlab)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.matlab + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.matlab + + # fenced markdown: mustache + - match: '(```|~~~|{%\s*highlight)\s*(mustache)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.html.mustache + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.html.mustache + + # fenced markdown: nginx + - match: '(```|~~~|{%\s*highlight)\s*(nginx)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.nginx + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.nginx + + # fenced markdown: objc + - match: '(```|~~~|{%\s*highlight)\s*(objc|objective-c)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.objc + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.objc + + # fenced markdown: objc++ + - match: '(```|~~~|{%\s*highlight)\s*(objc\+\+|objective-c\+\+)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.objc++ + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.objc++ + + # fenced markdown: ocaml + - match: '(```|~~~|{%\s*highlight)\s*(ocaml)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.ocaml + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.ocaml + + # fenced markdown: ocamllex + - match: '(```|~~~|{%\s*highlight)\s*(ocamllex)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.ocamllex + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.ocamllex + + # fenced markdown: ocamlyacc + - match: '(```|~~~|{%\s*highlight)\s*(ocamlyacc)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.ocamlyacc + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.ocamlyacc + + # fenced markdown: pascal + - match: '(```|~~~|{%\s*highlight)\s*(pascal)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.pascal + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.pascal + + # fenced markdown: perl + - match: '(```|~~~|{%\s*highlight)\s*(perl)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.perl + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.perl + + # fenced markdown: pgsql + - match: '(```|~~~|{%\s*highlight)\s*(pgsql|postgres|postgresql)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.pgsql + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.pgsql + + # fenced markdown: php + - match: '(```|~~~|{%\s*highlight)\s*(php)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.php + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.php + + # fenced markdown: plain + - match: '(```|~~~|{%\s*highlight)\s*(plain)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.plain + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.plain + + # fenced markdown: procfile + - match: '(```|~~~|{%\s*highlight)\s*(procfile)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.procfile + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.procfile + + # fenced markdown: puppet + - match: '(```|~~~|{%\s*highlight)\s*(puppet)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.puppet + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.puppet + + # fenced markdown: python + - match: '(```|~~~|{%\s*highlight)\s*(python)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.python + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.python + + # fenced markdown: regexp + - match: '(```|~~~|{%\s*highlight)\s*(regexp)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.regexp + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.regexp + + # fenced markdown: regexp.pyjade + - match: '(```|~~~|{%\s*highlight)\s*(regexp\.pyjade)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.pyjade + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.pyjade + + # fenced markdown: regexp.python + - match: '(```|~~~|{%\s*highlight)\s*(regexp\.python)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.regexp.python + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.regexp.python + + # fenced markdown: ruby + - match: '(```|~~~|{%\s*highlight)\s*(ruby)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.ruby + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.ruby + + # fenced markdown: rust + - match: '(```|~~~|{%\s*highlight)\s*(rust)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.rust + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.rust + + # fenced markdown: sass + - match: '(```|~~~|{%\s*highlight)\s*(sass)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.sass + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.sass + + # fenced markdown: scala + - match: '(```|~~~|{%\s*highlight)\s*(scala)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.scala + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.scala + + # fenced markdown: scss + - match: '(```|~~~|{%\s*highlight)\s*(scss)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.scss + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.scss + + # fenced markdown: styl + - match: '(```|~~~|{%\s*highlight)\s*(styl)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.stylus + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.stylus + + # fenced markdown: swift + - match: '(```|~~~|{%\s*highlight)\s*(swift)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.swift + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.swift + + # fenced markdown: tex + - match: '(```|~~~|{%\s*highlight)\s*(tex)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.tex + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.tex + + # fenced markdown: textile + - match: '(```|~~~|{%\s*highlight)\s*(textile)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.html.textile + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.html.textile + + # fenced markdown: todo + - match: '(```|~~~|{%\s*highlight)\s*(todo)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.todo + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.todo + + # fenced markdown: twig + - match: '(```|~~~|{%\s*highlight)\s*(twig)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.html.twig + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.html.twig + + # fenced markdown: xml + - match: '(```|~~~|{%\s*highlight)\s*(xml)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.xml + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.xml + + # fenced markdown: xml + - match: '(```|~~~|{%\s*highlight)\s*(xml)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.xml + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.xml + + # fenced markdown: yaml + - match: '(```|~~~|{%\s*highlight)\s*(yaml)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.yaml + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.yaml \ No newline at end of file diff --git a/build/output/syntax.yaml b/build/output/syntax.yaml new file mode 100644 index 0000000..14ef4c0 --- /dev/null +++ b/build/output/syntax.yaml @@ -0,0 +1,2158 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: Markdown Extended Dev +file_extensions: [mkdown, mdown, markdown, markdn, md.hbs, md] +scope: text.html.markdown + +contexts: + # lookahead for front-matter + main: + - match: (?=\A-{3}(\w*)[^\S\n]*$) + push: front-matter + - match: "" + set: body + + # begin front-matter + front-matter: + - match: ^---(ya?ml)? *$ + captures: + 1: punctuation.definition.fenced.yaml + 2: variable.language.fenced.yaml + with_prototype: + - include: scope:source.yaml#prototype + push: + - meta_scope: markup.raw.yaml.front-matter + - meta_content_scope: source.yaml + - match: ^(?:-|\.){3} *$ + pop: true + - include: scope:source.yaml + + - match: ^---(js|javascript)? *$ + captures: + 1: punctuation.definition.fenced.js + 2: variable.language.fenced.js + with_prototype: + - include: scope:source.js#prototype + push: + - meta_scope: markup.raw.js.front-matter + - meta_content_scope: source.js + - match: ^(?:-|\.){3} *$ + pop: true + - include: scope:source.js + + - match: ^---coffee *$ + captures: + 1: punctuation.definition.fenced.coffee + 2: variable.language.fenced.coffee + with_prototype: + - include: scope:source.coffee#prototype + push: + - meta_scope: markup.raw.coffee.front-matter + - meta_content_scope: source.coffee + - match: ^(?:-|\.){3} *$ + pop: true + - include: scope:source.coffee + + - match: ^---json *$ + captures: + 1: punctuation.definition.fenced.json + 2: variable.language.fenced.json + with_prototype: + - include: scope:source.json#prototype + push: + - meta_scope: markup.raw.json.front-matter + - meta_content_scope: source.json + - match: ^(?:-|\.){3} *$ + pop: true + - include: scope:source.json + + - match: $^ + pop: true + set: body + + # begin body + body: + - match: |- + (?x)^ + (?= [ ]{,3}>. + | ([ ]{4}|\t)(?!$) + | [#]{1,6}\s*+ + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[^\S\n]*+$ + ) + comment: "We could also use an empty end match and set applyEndPatternLast, but then we must be sure that the begin pattern will only match stuff matched by the sub-patterns." + push: + - meta_scope: meta.block-level.markdown + - match: |- + (?x)^ + (?! [ ]{,3}>. + | ([ ]{4}|\t) + | [#]{1,6}\s*+ + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[^\S\n]*+$ + ) + pop: true + - include: block_quote + - include: block_raw + - include: heading + - include: separator + + + # fenced markdown: applescript + - match: '(```|~~~|{%\s*highlight)\s*(applescript)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.applescript + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.applescript + + # fenced markdown: asp + - match: '(```|~~~|{%\s*highlight)\s*(asp)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.asp + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.asp + + # fenced markdown: bash + - match: '(```|~~~|{%\s*highlight)\s*(bash|sh|shell)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.shell + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.shell + + # fenced markdown: bibtex + - match: '(```|~~~|{%\s*highlight)\s*(bibtex)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.bibtex + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.bibtex + + # fenced markdown: c + - match: '(```|~~~|{%\s*highlight)\s*(c)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.c + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.c + + # fenced markdown: clojure + - match: '(```|~~~|{%\s*highlight)\s*(clojure)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.clojure + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.clojure + + # fenced markdown: cmake + - match: '(```|~~~|{%\s*highlight)\s*(cmake)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.cmake + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.cmake + + # fenced markdown: coffee + - match: '(```|~~~|{%\s*highlight)\s*(coffee|coffeescript)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.coffee + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.coffee + + # fenced markdown: cpp + - match: '(```|~~~|{%\s*highlight)\s*(cpp)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.c++ + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.c++ + + # fenced markdown: csharp + - match: '(```|~~~|{%\s*highlight)\s*(csharp)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.cs + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.cs + + # fenced markdown: css + - match: '(```|~~~|{%\s*highlight)\s*(css)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.css + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.css + + # fenced markdown: d + - match: '(```|~~~|{%\s*highlight)\s*(d)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.d + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.d + + # fenced markdown: ddl + - match: '(```|~~~|{%\s*highlight)\s*(ddl|dml|mysql|sql)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.sql + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.sql + + # fenced markdown: diff + - match: '(```|~~~|{%\s*highlight)\s*(diff)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.diff + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.diff + + # fenced markdown: dockerfile + - match: '(```|~~~|{%\s*highlight)\s*(dockerfile)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.dockerfile + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.dockerfile + + # fenced markdown: dosbatch + - match: '(```|~~~|{%\s*highlight)\s*(dosbatch)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.dosbatch + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.dosbatch + + # fenced markdown: dot + - match: '(```|~~~|{%\s*highlight)\s*(dot)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.dot + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.dot + + # fenced markdown: editorconfig + - match: '(```|~~~|{%\s*highlight)\s*(editorconfig)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.ini.editorconfig + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.ini.editorconfig + + # fenced markdown: ejs + - match: '(```|~~~|{%\s*highlight)\s*(ejs|lodash|underscore)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.ejs + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.ejs + + # fenced markdown: erb + - match: '(```|~~~|{%\s*highlight)\s*(erb|html\+ruby|rails)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.html.ruby + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.html.ruby + + # fenced markdown: erlang + - match: '(```|~~~|{%\s*highlight)\s*(erlang)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.erlang + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.erlang + + # fenced markdown: git + - match: '(```|~~~|{%\s*highlight)\s*(git)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.git + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.git + + # fenced markdown: go + - match: '(```|~~~|{%\s*highlight)\s*(go|golang)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.go + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.go + + # fenced markdown: gradle + - match: '(```|~~~|{%\s*highlight)\s*(gradle)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.gradle + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.gradle + + # fenced markdown: graphql + - match: '(```|~~~|{%\s*highlight)\s*(graphql)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.graphql + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.graphql + + # fenced markdown: groovy + - match: '(```|~~~|{%\s*highlight)\s*(groovy)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.groovy + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.groovy + + # fenced markdown: gruntfile.coffee + - match: '(```|~~~|{%\s*highlight)\s*(gruntfile\.coffee)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.gruntfile.coffee + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.gruntfile.coffee + + # fenced markdown: gruntfile.js + - match: '(```|~~~|{%\s*highlight)\s*(gruntfile\.js)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.gruntfile.js + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.gruntfile.js + + # fenced markdown: gulpfile.coffee + - match: '(```|~~~|{%\s*highlight)\s*(gulpfile\.coffee)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.gulpfile.coffee + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.gulpfile.coffee + + # fenced markdown: gulpfile.js + - match: '(```|~~~|{%\s*highlight)\s*(gulpfile\.js)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.gulpfile.js + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.gulpfile.js + + # fenced markdown: haml + - match: '(```|~~~|{%\s*highlight)\s*(haml)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.haml + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.haml + + # fenced markdown: handlebars + - match: '(```|~~~|{%\s*highlight)\s*(handlebars|hbs|html|html5)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.html.basic + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.html.basic + - include: scope:text.html.handlebars + + # fenced markdown: haskell + - match: '(```|~~~|{%\s*highlight)\s*(haskell)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.haskell + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.haskell + + # fenced markdown: ini + - match: '(```|~~~|{%\s*highlight)\s*(ini)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.ini + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.ini + + # fenced markdown: jade + - match: '(```|~~~|{%\s*highlight)\s*(jade)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.jade + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.jade + + # fenced markdown: java + - match: '(```|~~~|{%\s*highlight)\s*(java)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.java + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.java + + # fenced markdown: javadoc + - match: '(```|~~~|{%\s*highlight)\s*(javadoc)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.html.javadoc + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.html.javadoc + + # fenced markdown: javascript + - match: '(```|~~~|{%\s*highlight)\s*(javascript|js)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.js + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.js + + # fenced markdown: jl + - match: '(```|~~~|{%\s*highlight)\s*(jl|julia)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.julia + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.julia + + # fenced markdown: json + - match: '(```|~~~|{%\s*highlight)\s*(json)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.json + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.json + + # fenced markdown: jsx + - match: '(```|~~~|{%\s*highlight)\s*(jsx)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.jsx + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.jsx + + # fenced markdown: latex + - match: '(```|~~~|{%\s*highlight)\s*(latex)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.tex.latex + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.tex.latex + + # fenced markdown: less + - match: '(```|~~~|{%\s*highlight)\s*(less)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.less + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.less + + # fenced markdown: liquid + - match: '(```|~~~|{%\s*highlight)\s*(liquid|swig)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.html.swig + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.html.swig + + # fenced markdown: LiveScript + - match: '(```|~~~|{%\s*highlight)\s*(LiveScript|livescript|ls)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.livescript + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.livescript + + # fenced markdown: lua + - match: '(```|~~~|{%\s*highlight)\s*(lua)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.lua + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.lua + + # fenced markdown: makefile + - match: '(```|~~~|{%\s*highlight)\s*(makefile)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.makefile + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.makefile + + # fenced markdown: markdown + - match: '(```|~~~|{%\s*highlight)\s*(markdown|md)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.html.multimarkdown + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.html.multimarkdown + + # fenced markdown: math + - match: '(```|~~~|{%\s*highlight)\s*(math)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.tex.math + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.tex.math + + # fenced markdown: matlab + - match: '(```|~~~|{%\s*highlight)\s*(matlab)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.matlab + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.matlab + + # fenced markdown: mustache + - match: '(```|~~~|{%\s*highlight)\s*(mustache)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.html.mustache + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.html.mustache + + # fenced markdown: nginx + - match: '(```|~~~|{%\s*highlight)\s*(nginx)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.nginx + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.nginx + + # fenced markdown: objc + - match: '(```|~~~|{%\s*highlight)\s*(objc|objective-c)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.objc + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.objc + + # fenced markdown: objc++ + - match: '(```|~~~|{%\s*highlight)\s*(objc\+\+|objective-c\+\+)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.objc++ + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.objc++ + + # fenced markdown: ocaml + - match: '(```|~~~|{%\s*highlight)\s*(ocaml)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.ocaml + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.ocaml + + # fenced markdown: ocamllex + - match: '(```|~~~|{%\s*highlight)\s*(ocamllex)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.ocamllex + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.ocamllex + + # fenced markdown: ocamlyacc + - match: '(```|~~~|{%\s*highlight)\s*(ocamlyacc)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.ocamlyacc + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.ocamlyacc + + # fenced markdown: pascal + - match: '(```|~~~|{%\s*highlight)\s*(pascal)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.pascal + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.pascal + + # fenced markdown: perl + - match: '(```|~~~|{%\s*highlight)\s*(perl)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.perl + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.perl + + # fenced markdown: pgsql + - match: '(```|~~~|{%\s*highlight)\s*(pgsql|postgres|postgresql)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.pgsql + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.pgsql + + # fenced markdown: php + - match: '(```|~~~|{%\s*highlight)\s*(php)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.php + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.php + + # fenced markdown: plain + - match: '(```|~~~|{%\s*highlight)\s*(plain)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.plain + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.plain + + # fenced markdown: procfile + - match: '(```|~~~|{%\s*highlight)\s*(procfile)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.procfile + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.procfile + + # fenced markdown: puppet + - match: '(```|~~~|{%\s*highlight)\s*(puppet)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.puppet + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.puppet + + # fenced markdown: python + - match: '(```|~~~|{%\s*highlight)\s*(python)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.python + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.python + + # fenced markdown: regexp + - match: '(```|~~~|{%\s*highlight)\s*(regexp)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.regexp + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.regexp + + # fenced markdown: regexp.pyjade + - match: '(```|~~~|{%\s*highlight)\s*(regexp\.pyjade)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.pyjade + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.pyjade + + # fenced markdown: regexp.python + - match: '(```|~~~|{%\s*highlight)\s*(regexp\.python)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.regexp.python + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.regexp.python + + # fenced markdown: ruby + - match: '(```|~~~|{%\s*highlight)\s*(ruby)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.ruby + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.ruby + + # fenced markdown: rust + - match: '(```|~~~|{%\s*highlight)\s*(rust)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.rust + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.rust + + # fenced markdown: sass + - match: '(```|~~~|{%\s*highlight)\s*(sass)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.sass + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.sass + + # fenced markdown: scala + - match: '(```|~~~|{%\s*highlight)\s*(scala)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.scala + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.scala + + # fenced markdown: scss + - match: '(```|~~~|{%\s*highlight)\s*(scss)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.scss + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.scss + + # fenced markdown: styl + - match: '(```|~~~|{%\s*highlight)\s*(styl)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.stylus + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.stylus + + # fenced markdown: swift + - match: '(```|~~~|{%\s*highlight)\s*(swift)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.swift + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.swift + + # fenced markdown: tex + - match: '(```|~~~|{%\s*highlight)\s*(tex)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.tex + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.tex + + # fenced markdown: textile + - match: '(```|~~~|{%\s*highlight)\s*(textile)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.html.textile + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.html.textile + + # fenced markdown: todo + - match: '(```|~~~|{%\s*highlight)\s*(todo)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.todo + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.todo + + # fenced markdown: twig + - match: '(```|~~~|{%\s*highlight)\s*(twig)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.html.twig + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.html.twig + + # fenced markdown: xml + - match: '(```|~~~|{%\s*highlight)\s*(xml)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.xml + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.xml + + # fenced markdown: xml + - match: '(```|~~~|{%\s*highlight)\s*(xml)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.xml + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.xml + + # fenced markdown: yaml + - match: '(```|~~~|{%\s*highlight)\s*(yaml)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.yaml + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.yaml + + # fenced markdown: generic + - match: '(```|~~~|{%\s*highlight)\s*(\w*)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + + # fenced markdown: r + - match: '(```|~~~)\s*\{?\s*(r)(?:[ \},].*$|\}?$)' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.r + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.r + + # fenced markdown: rails + - match: '(```|~~~|{%\s*highlight)\s*(rails|erb|html\+ruby)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - match: '' + push: + - meta_content_scope: text.html.ruby + - include: scope:text.html.ruby + with_prototype: + - match: '(?=(```|~~~|{%\s*endhighlight\s*%})\n)' + pop: true + + # lists + - match: '^[ ]{0,3}([*+-])(?=\s)' + captures: + 1: punctuation.definition.list_item.markdown + push: + - meta_scope: markup.list.unnumbered.markdown + - match: ^(?=\S) + captures: + 1: punctuation.definition.list_item.markdown + pop: true + - include: list-paragraph + - match: '^[ ]{0,3}([0-9]+)(\.)(?=\s)' + captures: + 1: punctuation.definition.list_item.markdown punctuation.definition.list_item.number.markdown + 2: punctuation.definition.list_item.markdown + push: + - meta_scope: markup.list.numbered.markdown + - match: ^(?=\S) + captures: + 1: punctuation.definition.list_item.markdown punctuation.definition.list_item.number.markdown + 2: punctuation.definition.list_item.markdown + pop: true + - include: list-paragraph + + # html tags + - match: '^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)(?!.*?</\1>)' + comment: Markdown formatting is disabled inside block-level tags. + push: + - meta_scope: meta.disable-markdown + - match: (?<=^</\1>$\n) + pop: true + - include: scope:text.html.basic + - include: scope:text.html.handlebars + + - match: '^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)' + comment: Same rule but for one line disables. + push: + - meta_scope: meta.disable-markdown + - match: $\n? + pop: true + - include: scope:text.html.basic + - include: scope:text.html.handlebars + - match: (?x:\s*(\[)(.+?)(\])(:)(?:[^\S\n]*(<?)(\S+?)(>?))?[^\S\n]*(?:((\().+?(\)))|((").+?(")))?\s*$) + # - match: |- + # (?x: + # \s* # Leading whitespace + # (\[)(.+?)(\])(:) # Reference name + # [^\S\n]* # Optional whitespace + # (<?)(\S+?)(>?) # The url + # [^\S\n]* # Optional whitespace + # (?: + # ((\().+?(\))) # Match title in quotes… + # | ((").+?(")) # or in parens. + # )? # Title is optional + # \s* # Optional whitespace + # $ + # ) + scope: meta.link.reference.def.markdown + captures: + 1: punctuation.definition.constant.markdown + 2: constant.other.reference.link.markdown + 3: punctuation.definition.constant.markdown + 4: punctuation.separator.key-value.markdown + 5: punctuation.definition.link.markdown + 6: markup.underline.link.markdown + 7: punctuation.definition.link.markdown + 8: string.other.link.description.title.markdown + 9: punctuation.definition.string.begin.markdown + 10: punctuation.definition.string.end.markdown + 11: string.other.link.description.title.markdown + 12: punctuation.definition.string.begin.markdown + 13: punctuation.definition.string.end.markdown + - match: '^(?=\S)(?![=-]{3,}(?=$))' + push: + - meta_scope: meta.paragraph.markdown + - include: html_comment + - match: '^(?:\s*$|(?=[ ]{,3}>.))|(?=[^\S\n]*\n)(?<=^===|^====|=====|^---|^----|-----)[^\S\n]*\n|(?=^#)' + pop: true + - include: inline + - include: scope:text.html.handlebars + - match: '^(={3,})(?=[^\S\n]*$)' + scope: markup.heading.1.markdown + captures: + 1: punctuation.definition.heading.markdown + - match: '^(-{3,})(?=[^\S\n]*$)' + scope: markup.heading.2.markdown + captures: + 1: punctuation.definition.heading.markdown + + html_comment: + - match: <!-- + captures: + 0: punctuation.definition.comment.html + push: + - meta_scope: comment.block.html + - match: '--\s*>' + pop: true + - match: '--' + scope: invalid.illegal.bad-comments-or-CDATA.html + ampersand: + - comment: "Markdown will convert this for us. We match it so that the HTML grammar will not mark it up as invalid." + match: '&(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)' + scope: meta.other.valid-ampersand.markdown + + block_quote: + - comment: "We terminate the block quote when seeing an empty line, a separator or a line with leading > characters. The latter is to “reset” the quote level for quoted lines." + match: '\G[ ]{,3}(>)(?!$)[ ]?' + captures: + 1: punctuation.definition.blockquote.markdown + push: + - meta_scope: markup.quote.markdown + - match: |- + (?x)^ + (?= \s*$ + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[^\S\n]*+$ + | [ ]{,3}>. + ) + pop: true + - match: \G(?= [ ]{,3}>.) + push: + - match: ^ + pop: true + - include: block_quote + - match: |- + (?x)\G + (?= ([ ]{4}|\t) + | [#]{1,6}\s*+ + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[^\S\n]*+$ + ) + push: + - include: block_raw + - include: heading + - include: separator + - match: ^ + pop: true + - match: |- + (?x)\G + (?! $ + | [ ]{,3}>. + | ([ ]{4}|\t) + | [#]{1,6}\s*+ + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[^\S\n]*+$ + ) + push: + - match: $|(?<=\n) + pop: true + - include: inline + block_raw: + - match: '\G([ ]{4}|\t).*$\n?' + scope: markup.raw.block.markdown + bold: + - match: |- + (?x) + (\*\*|__)(?=\S) # Open + (?= + ( + <[^>]*+> # HTML tags + | (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> + # Raw + | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes + | \[ + ( + (?<square> # Named group + [^\[\]\\] # Match most chars + | \\. # Escaped chars + | \[ \g<square>*+ \] # Nested brackets + )*+ + \] + ( + ( # Reference Link + [ ]? # Optional space + \[[^\]]*+\] # Ref name + ) + | ( # Inline Link + \( # Opening paren + [^\S\n]*+ # Optional whitespace + <?(.*?)>? # URL + [^\S\n]*+ # Optional whitespace + ( # Optional Title + (?<title>['"]) + (.*?) + \k<title> + )? + \) + ) + ) + ) + | (?!(?<=\S)\1). # Everything besides + # style closer + )++ + (?<=\S)\1 # Close + ) + captures: + 1: punctuation.definition.bold.markdown + push: + - meta_scope: markup.bold.markdown + - match: (?<=\S)(\1) + captures: + 1: punctuation.definition.bold.markdown + pop: true + - match: "(?=<[^>]*?>)" + push: + - include: scope:text.html.handlebars + - match: (?<=>) + pop: true + - include: escape + - include: ampersand + - include: bracket + - include: raw + - include: italic + - include: strike + - include: image-inline + - include: link-inline + - include: link-inet + - include: link-email + - include: image-reference + - include: link-reference-literal + - include: link-reference + bracket: + - match: '<(?![a-z/?\$!])' + comment: | + Markdown will convert this for us. We match it so that the + HTML grammar will not mark it up as invalid. + scope: meta.other.valid-bracket.markdown + escape: + - match: '\\[-`*_#+.!(){}\[\]\\>]' + scope: constant.character.escape.markdown + heading: + - match: '\G(#{1})(?!#)\s*(?=\S)' + captures: + 1: punctuation.definition.heading.markdown + push: + - meta_scope: markup.heading.markdown markup.heading.1.markdown + - match: '\s*(#*)$\n?' + captures: + 1: punctuation.definition.heading.markdown + pop: true + - include: inline + - match: '\G(#{2})(?!#)\s*(?=\S)' + captures: + 1: punctuation.definition.heading.markdown + push: + - meta_scope: markup.heading.markdown markup.heading.2.markdown + - match: '\s*(#*)$\n?' + captures: + 1: punctuation.definition.heading.markdown + pop: true + - include: inline + - match: '\G(#{3})(?!#)\s*(?=\S)' + captures: + 1: punctuation.definition.heading.markdown + push: + - meta_scope: markup.heading.markdown markup.heading.3.markdown + - match: '\s*(#*)$\n?' + captures: + 1: punctuation.definition.heading.markdown + pop: true + - include: inline + - match: '\G(#{4})(?!#)\s*(?=\S)' + captures: + 1: punctuation.definition.heading.markdown + push: + - meta_scope: markup.heading.markdown markup.heading.4.markdown + - match: '\s*(#*)$\n?' + captures: + 1: punctuation.definition.heading.markdown + pop: true + - include: inline + - match: '\G(#{5})(?!#)\s*(?=\S)' + captures: + 1: punctuation.definition.heading.markdown + push: + - meta_scope: markup.heading.markdown markup.heading.5.markdown + - match: '\s*(#*)$\n?' + captures: + 1: punctuation.definition.heading.markdown + pop: true + - include: inline + - match: '\G(#{6})(?!#)\s*(?=\S)' + captures: + 1: punctuation.definition.heading.markdown + push: + - meta_scope: markup.heading.markdown markup.heading.6.markdown + - match: '\s*(#*)$\n?' + captures: + 1: punctuation.definition.heading.markdown + pop: true + - include: inline + image-inline: + - match: |- + (?x: + \! # Images start with ! + (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) + # Match the link text. + ([ ])? # Space not allowed + (\() # Opening paren for url + (<?)(\S+?)(>?) # The url + [^\S\n]* # Optional whitespace + (?: + ((\().+?(\))) # Match title in parens… + | ((").+?(")) # or in quotes. + )? # Title is optional + \s* # Optional whitespace + (\)) + ) + scope: meta.image.inline.markdown + captures: + 1: punctuation.definition.string.begin.markdown + 2: string.other.link.description.markdown + 4: punctuation.definition.string.end.markdown + 5: invalid.illegal.whitespace.markdown + 6: punctuation.definition.metadata.markdown + 7: punctuation.definition.link.markdown + 8: markup.underline.link.image.markdown + 9: punctuation.definition.link.markdown + 10: string.other.link.description.title.markdown + 11: punctuation.definition.string.markdown + 12: punctuation.definition.string.markdown + 13: string.other.link.description.title.markdown + 14: punctuation.definition.string.markdown + 15: punctuation.definition.string.markdown + 16: punctuation.definition.metadata.markdown + image-reference: + - match: '\!(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*)(\])[ ]?(\[)(.*?)(\])' + scope: meta.image.reference.markdown + captures: + 1: punctuation.definition.string.begin.markdown + 2: string.other.link.description.markdown + 4: punctuation.definition.string.begin.markdown + 5: punctuation.definition.constant.markdown + 6: constant.other.reference.link.markdown + 7: punctuation.definition.constant.markdown + inline: + - include: escape + - include: ampersand + - include: bracket + - include: raw + - include: bold + - include: italic + - include: strike + - include: line-break + - include: image-inline + - include: link-inline + - include: link-inet + - include: link-email + - include: image-reference + - include: link-reference-literal + - include: link-reference + - include: latex-inline + italic: + - match: |- + (?x) + (\*|_)(?=\S) # Open + (?= + ( + <[^>]*+> # HTML tags + | (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> + # Raw + | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes + | \[ + ( + (?<square> # Named group + [^\[\]\\] # Match most chars + | \\. # Escaped chars + | \[ \g<square>*+ \] # Nested brackets + )*+ + \] + ( + ( # Reference Link + [ ]? # Optional space + \[[^\]]*+\] # Ref name + ) + | ( # Inline Link + \( # Opening paren + [^\S\n]*+ # Optional whtiespace + <?(.*?)>? # URL + [^\S\n]*+ # Optional whtiespace + ( # Optional Title + (?<title>['"]) + (.*?) + \k<title> + )? + \) + ) + ) + ) + | \1\1 # Must be bold closer + | (?!(?<=\S)\1). # Everything besides + # style closer + )++ + (?<=\S)\1 # Close + ) + captures: + 1: punctuation.definition.italic.markdown + push: + - meta_scope: markup.italic.markdown + - match: (?<=\S)(\1)((?!\1)|(?=\1\1)) + captures: + 1: punctuation.definition.italic.markdown + pop: true + - match: "(?=<[^>]*?>)" + push: + - include: scope:text.html.handlebars + - match: (?<=>) + pop: true + - include: escape + - include: ampersand + - include: bracket + - include: raw + - include: bold + - include: strike + - include: image-inline + - include: link-inline + - include: link-inet + - include: link-email + - include: image-reference + - include: link-reference-literal + - include: link-reference + line-break: + - match: " {2,}$" + scope: meta.dummy.line-break + link-email: + - match: '(<)((?:mailto:)?[-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(>)' + scope: meta.link.email.lt-gt.markdown + captures: + 1: punctuation.definition.link.markdown + 2: markup.underline.link.markdown + 4: punctuation.definition.link.markdown + link-inet: + - match: (<)((?:https?|ftp)://.*?)(>) + scope: meta.link.inet.markdown + captures: + 1: punctuation.definition.link.markdown + 2: markup.underline.link.markdown + 3: punctuation.definition.link.markdown + link-inline: + - match: |- + (?x: + (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) + # Match the link text. + ([ ])? # Space not allowed + (\() # Opening paren for url + (<?)(.*?)(>?) # The url + [^\S\n]* # Optional whitespace + (?: + ((\().+?(\))) # Match title in parens… + | ((").+?(")) # or in quotes. + )? # Title is optional + \s* # Optional whitespace + (\)) + ) + scope: meta.link.inline.markdown + captures: + 1: punctuation.definition.string.begin.markdown + 2: string.other.link.title.markdown + 4: punctuation.definition.string.end.markdown + 5: invalid.illegal.whitespace.markdown + 6: punctuation.definition.metadata.markdown + 7: punctuation.definition.link.markdown + 8: markup.underline.link.markdown + 9: punctuation.definition.link.markdown + 10: string.other.link.description.title.markdown + 11: punctuation.definition.string.begin.markdown + 12: punctuation.definition.string.end.markdown + 13: string.other.link.description.title.markdown + 14: punctuation.definition.string.begin.markdown + 15: punctuation.definition.string.end.markdown + 16: punctuation.definition.metadata.markdown + link-reference: + - match: '(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*)(\]) ?(\[)([^\]]*)(\])' + scope: meta.link.reference.markdown + captures: + 1: punctuation.definition.string.begin.markdown + 2: string.other.link.title.markdown + 4: punctuation.definition.string.end.markdown + 5: punctuation.definition.constant.begin.markdown + 6: constant.other.reference.link.markdown + 7: punctuation.definition.constant.end.markdown + link-reference-literal: + - match: '(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*)(\]) ?(\[)(\])' + scope: meta.link.reference.literal.markdown + captures: + 1: punctuation.definition.string.begin.markdown + 2: string.other.link.title.markdown + 4: punctuation.definition.string.end.markdown + 5: punctuation.definition.constant.begin.markdown + 6: punctuation.definition.constant.end.markdown + list-paragraph: + - match: \G\s+(?=\S) + push: + - meta_scope: meta.paragraph.list.markdown + - match: ^\s*$ + pop: true + - match: '^\s{0,4}([*+-]|([0-9]+)\.)(?=\s)' + captures: + 1: punctuation.definition.list_item.markdown + 2: punctuation.definition.list_item.number.markdown + - include: inline + raw: + - include: latex-display + - match: '(`+)([^`]|(?!(?<!`)\1(?!`))`)*+(\1)' + scope: markup.raw.inline.markdown + captures: + 1: punctuation.definition.raw.markdown + 3: punctuation.definition.raw.markdown + separator: + - match: '\G[ ]{,3}([-*_])([ ]{,2}\1){2,}[^\S\n]*$\n?' + scope: meta.separator.markdown + strike: + - match: |- + (?x) + (~~)(?=\S) # Open + (?= + ( + <[^>]*+> # HTML tags + | (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> + # Raw + | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes + | \[ + ( + (?<square> # Named group + [^\[\]\\] # Match most chars + | \\. # Escaped chars + | \[ \g<square>*+ \] # Nested brackets + )*+ + \] + ( + ( # Reference Link + [ ]? # Optional space + \[[^\]]*+\] # Ref name + ) + | ( # Inline Link + \( # Opening paren + [^\S\n]*+ # Optional whtiespace + <?(.*?)>? # URL + [^\S\n]*+ # Optional whtiespace + ( # Optional Title + (?<title>['"]) + (.*?) + \k<title> + )? + \) + ) + ) + ) + | \1\1 # Must be bold closer + | (?!(?<=\S)\1). # Everything besides + # style closer + )++ + (?<=\S)\1 # Close + ) + captures: + 1: punctuation.definition.strike.markdown + push: + - meta_scope: markup.strike.markdown + - match: (?<=\S)(\1)((?!\1)|(?=\1\1)) + captures: + 1: punctuation.definition.strike.markdown + pop: true + - match: "(?=<[^>]*?>)" + push: + - include: scope:text.html.handlebars + - match: (?<=>) + pop: true + - include: escape + - include: ampersand + - include: bracket + - include: raw + - include: bold + - include: italic + - include: image-inline + - include: link-inline + - include: link-inet + - include: link-email + - include: image-reference + - include: link-reference-literal + - include: link-reference + + latex-inline: + - match: \\\$ + - match: |- + (?x) + (\$)(?=[^\s\$]) + (?= + (?: + \\\\ + |\\\$ + |[^\$] + )*? + \S\$(?:[^a-zA-Z0-9]|$) + ) + scope: string.other.math.latex punctuation.definition.string.begin.latex + push: + - meta_scope: text.tex.latex meta.environment.math.latex + - include: scope:text.tex.latex#macros + - include: scope:text.tex.latex#math-content + - match: \$ + scope: string.other.math.latex punctuation.definition.string.end.latex + pop: true + + latex-display: + - match: \$\$ + scope: string.other.math.latex punctuation.definition.string.begin.latex + push: + - meta_scope: text.tex.latex meta.environment.math.latex + - include: scope:text.tex.latex#macros + - include: scope:text.tex.latex#math-content + - match: \$\$ + scope: string.other.math.latex punctuation.definition.string.end.latex + pop: true diff --git a/build/render.js b/build/render.js new file mode 100644 index 0000000..471c808 --- /dev/null +++ b/build/render.js @@ -0,0 +1,78 @@ +const fs = require('fs'); +const path = require('path'); +const argv = process.argv.slice(2); + +const date = () => { + let d = new Date(); + let mo = d.getUTCMonth() + 1; + let dd = d.getUTCDate(); + let yr = d.getUTCFullYear(); + var hrs = d.getHours(); + var min = d.getMinutes(); + var sec = d.getSeconds(); + return `${yr}${mo}${dd}${hrs}${min}${sec}`; +}; + +const renderFences = (filepath, context) => { + let str = fs.readFileSync(path.join(__dirname, filepath), 'utf8'); + let re = /{{([^}]+?)}}/g; + let definitions = []; + + for (let definition of context.definitions) { + definitions.push('', `# fenced markdown: ${definition.name.replace(/^(text|source)\./, '')}`); + let val = str.replace(re, (m, $1) => definition[$1]); + if (definition.append) val += '\n' + definition.append; + definitions.push(val); + } + + let res = definitions.join('\n'); + return res.replace(/^/gm, ' '); +}; + +function backupFenzes() { + let existing = path.join(__dirname, 'output/fences.yaml'); + let newFile = path.join(__dirname, `backups/fences-${date()}.yaml`); + fs.copyFileSync(existing, newFile); +} + +function writeFences() { + let res = renderFences('templates/fences.hbs', require('./data/context.js')); + if (argv.includes('--write')) { + let dest = path.join(__dirname, 'output/fences.yaml'); + fs.writeFileSync(dest, res); + } else { + console.log(res); + } +} + +function renderSyntax(filepath) { + let str = fs.readFileSync(path.join(__dirname, filepath), 'utf8'); + let fences = renderFences('templates/fences.hbs', require('./data/context.js')); + return str.replace('{{fences}}', fences); +} + +function backupSyntax() { + let existing = path.join(__dirname, '../Syntaxes/Markdown Extended.sublime-syntax'); + let newFile = path.join(__dirname, `backups/Markdown Extended-${date()}.sublime-syntax`); + fs.copyFileSync(existing, newFile); +} + +function writeSyntax() { + const res = renderSyntax('templates/syntax.hbs'); + if (argv.includes('--write')) { + fs.writeFileSync(path.join(__dirname, '../Syntaxes/Markdown Extended.sublime-syntax'), res); + console.log('updated syntax file'); + } else { + console.log(res); + } +} + +if (argv.includes('syntax')) { + backupSyntax(); + writeSyntax(); +} + +if (argv.includes('fences')) { + backupFenzes(); + writeFences(); +} diff --git a/build/templates/fences.hbs b/build/templates/fences.hbs new file mode 100644 index 0000000..cc078d4 --- /dev/null +++ b/build/templates/fences.hbs @@ -0,0 +1,15 @@ +- match: '(```|~~~|{%\s*highlight)\s*({{lang}})\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: {{scope}} + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:{{scope}} \ No newline at end of file diff --git a/build/templates/syntax.hbs b/build/templates/syntax.hbs new file mode 100644 index 0000000..1229b5d --- /dev/null +++ b/build/templates/syntax.hbs @@ -0,0 +1,793 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: Markdown Extended Dev +file_extensions: [mkdown, mdown, markdown, markdn, md.hbs, md] +scope: text.html.markdown + +contexts: + # lookahead for front-matter + main: + - match: (?=\A-{3}(\w*)[^\S\n]*$) + push: front-matter + - match: "" + set: body + + # begin front-matter + front-matter: + - match: ^(---)(ya?ml)? *$ + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + with_prototype: + - include: scope:source.yaml#prototype + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.yaml + - match: ^(---|\.{3}) *$ + captures: + 1: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.yaml + + - match: ^(---)(coffee) *$ + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + with_prototype: + - include: scope:source.coffee#prototype + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.coffee + - match: ^(---|\.{3}) *$ + captures: + 1: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.coffee + + - match: ^(---)(json) *$ + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + with_prototype: + - include: scope:source.json#prototype + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.json + - match: ^(---|\.{3}) *$ + captures: + 1: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.json + + - match: ^(---)(\w*) *$ + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + with_prototype: + - include: scope:text.plain#prototype + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: text.plain + - match: ^(---|\.{3}) *$ + captures: + 1: punctuation.definition.fenced.markdown + pop: true + - include: scope:text.plain + + - match: "" + pop: true + set: body + + # begin body + body: + - match: |- + (?x)^ + (?= [ ]{,3}>. + | ([ ]{4}|\t)(?!$) + | [#]{1,6}\s*+ + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[^\S\n]*+$ + ) + comment: "We could also use an empty end match and set applyEndPatternLast, but then we must be sure that the begin pattern will only match stuff matched by the sub-patterns." + push: + - meta_scope: meta.block-level.markdown + - match: |- + (?x)^ + (?! [ ]{,3}>. + | ([ ]{4}|\t) + | [#]{1,6}\s*+ + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[^\S\n]*+$ + ) + pop: true + - include: block_quote + - include: block_raw + - include: heading + - include: separator +{{fences}} + + # fenced markdown: javascript + - match: '(```|~~~|{%\s*highlight)\s*(javascript|js)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - match: '' + push: + - meta_content_scope: source.js + - include: scope:source.js + with_prototype: + - match: '(?=(```|~~~|{%\s*endhighlight\s*%})\n)' + pop: true + + # fenced markdown: r + - match: '(```|~~~)\s*\{?\s*(r)(?:[ \},].*$|\}?$)' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - meta_content_scope: source.r + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - include: scope:source.r + + # fenced markdown: rails + - match: '(```|~~~|{%\s*highlight)\s*(rails|erb|html\+ruby)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + - match: '' + push: + - meta_content_scope: text.html.ruby + - include: scope:text.html.ruby + with_prototype: + - match: '(?=(```|~~~|{%\s*endhighlight\s*%})\n)' + pop: true + + # fenced markdown: generic + - match: '(```|~~~|{%\s*highlight)\s*(\w*)\s*((?:linenos\s*)?%})?$' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + push: + - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown + - match: '(```|~~~|{%\s*endhighlight\s*%})\n' + captures: + 1: punctuation.definition.fenced.markdown + 2: variable.language.fenced.markdown + 3: punctuation.definition.fenced.markdown + pop: true + + # lists + - match: '^[ ]{0,3}([*+-])(?=\s)' + captures: + 1: punctuation.definition.list_item.markdown + push: + - meta_scope: markup.list.unnumbered.markdown + - match: ^(?=\S) + captures: + 1: punctuation.definition.list_item.markdown + pop: true + - include: list-paragraph + - match: '^[ ]{0,3}([0-9]+)(\.)(?=\s)' + captures: + 1: punctuation.definition.list_item.markdown punctuation.definition.list_item.number.markdown + 2: punctuation.definition.list_item.markdown + push: + - meta_scope: markup.list.numbered.markdown + - match: ^(?=\S) + captures: + 1: punctuation.definition.list_item.markdown punctuation.definition.list_item.number.markdown + 2: punctuation.definition.list_item.markdown + pop: true + - include: list-paragraph + + # html tags + - match: '^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)(?!.*?</\1>)' + comment: Markdown formatting is disabled inside block-level tags. + push: + - meta_scope: meta.disable-markdown + - match: (?<=^</\1>$\n) + pop: true + - include: scope:text.html.basic + - include: scope:text.html.handlebars + + - match: '^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)' + comment: Same rule but for one line disables. + push: + - meta_scope: meta.disable-markdown + - match: $\n? + pop: true + - include: scope:text.html.basic + - include: scope:text.html.handlebars + - match: (?x:\s*(\[)(.+?)(\])(:)(?:[^\S\n]*(<?)(\S+?)(>?))?[^\S\n]*(?:((\().+?(\)))|((").+?(")))?\s*$) + # - match: |- + # (?x: + # \s* # Leading whitespace + # (\[)(.+?)(\])(:) # Reference name + # [^\S\n]* # Optional whitespace + # (<?)(\S+?)(>?) # The url + # [^\S\n]* # Optional whitespace + # (?: + # ((\().+?(\))) # Match title in quotes… + # | ((").+?(")) # or in parens. + # )? # Title is optional + # \s* # Optional whitespace + # $ + # ) + scope: meta.link.reference.def.markdown + captures: + 1: punctuation.definition.constant.markdown + 2: constant.other.reference.link.markdown + 3: punctuation.definition.constant.markdown + 4: punctuation.separator.key-value.markdown + 5: punctuation.definition.link.markdown + 6: markup.underline.link.markdown + 7: punctuation.definition.link.markdown + 8: string.other.link.description.title.markdown + 9: punctuation.definition.string.begin.markdown + 10: punctuation.definition.string.end.markdown + 11: string.other.link.description.title.markdown + 12: punctuation.definition.string.begin.markdown + 13: punctuation.definition.string.end.markdown + - match: '^(?=\S)(?![=-]{3,}(?=$))' + push: + - meta_scope: meta.paragraph.markdown + - include: html_comment + - match: '^(?:\s*$|(?=[ ]{,3}>.))|(?=[^\S\n]*\n)(?<=^===|^====|=====|^---|^----|-----)[^\S\n]*\n|(?=^#)' + pop: true + - include: inline + - include: scope:text.html.handlebars + - match: '^(={3,})(?=[^\S\n]*$)' + scope: markup.heading.1.markdown + captures: + 1: punctuation.definition.heading.markdown + - match: '^(-{3,})(?=[^\S\n]*$)' + scope: markup.heading.2.markdown + captures: + 1: punctuation.definition.heading.markdown + + html_comment: + - match: <!-- + captures: + 0: punctuation.definition.comment.html + push: + - meta_scope: comment.block.html + - match: '--\s*>' + pop: true + - match: '--' + scope: invalid.illegal.bad-comments-or-CDATA.html + ampersand: + - comment: "Markdown will convert this for us. We match it so that the HTML grammar will not mark it up as invalid." + match: '&(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)' + scope: meta.other.valid-ampersand.markdown + + block_quote: + - comment: "We terminate the block quote when seeing an empty line, a separator or a line with leading > characters. The latter is to “reset” the quote level for quoted lines." + match: '\G[ ]{,3}(>)(?!$)[ ]?' + captures: + 1: punctuation.definition.blockquote.markdown + push: + - meta_scope: markup.quote.markdown + - match: |- + (?x)^ + (?= \s*$ + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[^\S\n]*+$ + | [ ]{,3}>. + ) + pop: true + - match: \G(?= [ ]{,3}>.) + push: + - match: ^ + pop: true + - include: block_quote + - match: |- + (?x)\G + (?= ([ ]{4}|\t) + | [#]{1,6}\s*+ + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[^\S\n]*+$ + ) + push: + - include: block_raw + - include: heading + - include: separator + - match: ^ + pop: true + - match: |- + (?x)\G + (?! $ + | [ ]{,3}>. + | ([ ]{4}|\t) + | [#]{1,6}\s*+ + | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[^\S\n]*+$ + ) + push: + - match: $|(?<=\n) + pop: true + - include: inline + block_raw: + - match: '\G([ ]{4}|\t).*$\n?' + scope: markup.raw.block.markdown + bold: + - match: |- + (?x) + (\*\*|__)(?=\S) # Open + (?= + ( + <[^>]*+> # HTML tags + | (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> + # Raw + | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes + | \[ + ( + (?<square> # Named group + [^\[\]\\] # Match most chars + | \\. # Escaped chars + | \[ \g<square>*+ \] # Nested brackets + )*+ + \] + ( + ( # Reference Link + [ ]? # Optional space + \[[^\]]*+\] # Ref name + ) + | ( # Inline Link + \( # Opening paren + [^\S\n]*+ # Optional whitespace + <?(.*?)>? # URL + [^\S\n]*+ # Optional whitespace + ( # Optional Title + (?<title>['"]) + (.*?) + \k<title> + )? + \) + ) + ) + ) + | (?!(?<=\S)\1). # Everything besides + # style closer + )++ + (?<=\S)\1 # Close + ) + captures: + 1: punctuation.definition.bold.markdown + push: + - meta_scope: markup.bold.markdown + - match: (?<=\S)(\1) + captures: + 1: punctuation.definition.bold.markdown + pop: true + - match: "(?=<[^>]*?>)" + push: + - include: scope:text.html.handlebars + - match: (?<=>) + pop: true + - include: escape + - include: ampersand + - include: bracket + - include: raw + - include: italic + - include: strike + - include: image-inline + - include: link-inline + - include: link-inet + - include: link-email + - include: image-reference + - include: link-reference-literal + - include: link-reference + bracket: + - match: '<(?![a-z/?\$!])' + comment: | + Markdown will convert this for us. We match it so that the + HTML grammar will not mark it up as invalid. + scope: meta.other.valid-bracket.markdown + escape: + - match: '\\[-`*_#+.!(){}\[\]\\>]' + scope: constant.character.escape.markdown + heading: + - match: '\G(#{1})(?!#)\s*(?=\S)' + captures: + 1: punctuation.definition.heading.markdown + push: + - meta_scope: markup.heading.markdown markup.heading.1.markdown + - match: '\s*(#*)$\n?' + captures: + 1: punctuation.definition.heading.markdown + pop: true + - include: inline + - match: '\G(#{2})(?!#)\s*(?=\S)' + captures: + 1: punctuation.definition.heading.markdown + push: + - meta_scope: markup.heading.markdown markup.heading.2.markdown + - match: '\s*(#*)$\n?' + captures: + 1: punctuation.definition.heading.markdown + pop: true + - include: inline + - match: '\G(#{3})(?!#)\s*(?=\S)' + captures: + 1: punctuation.definition.heading.markdown + push: + - meta_scope: markup.heading.markdown markup.heading.3.markdown + - match: '\s*(#*)$\n?' + captures: + 1: punctuation.definition.heading.markdown + pop: true + - include: inline + - match: '\G(#{4})(?!#)\s*(?=\S)' + captures: + 1: punctuation.definition.heading.markdown + push: + - meta_scope: markup.heading.markdown markup.heading.4.markdown + - match: '\s*(#*)$\n?' + captures: + 1: punctuation.definition.heading.markdown + pop: true + - include: inline + - match: '\G(#{5})(?!#)\s*(?=\S)' + captures: + 1: punctuation.definition.heading.markdown + push: + - meta_scope: markup.heading.markdown markup.heading.5.markdown + - match: '\s*(#*)$\n?' + captures: + 1: punctuation.definition.heading.markdown + pop: true + - include: inline + - match: '\G(#{6})(?!#)\s*(?=\S)' + captures: + 1: punctuation.definition.heading.markdown + push: + - meta_scope: markup.heading.markdown markup.heading.6.markdown + - match: '\s*(#*)$\n?' + captures: + 1: punctuation.definition.heading.markdown + pop: true + - include: inline + image-inline: + - match: |- + (?x: + \! # Images start with ! + (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) + # Match the link text. + ([ ])? # Space not allowed + (\() # Opening paren for url + (<?)(\S+?)(>?) # The url + [^\S\n]* # Optional whitespace + (?: + ((\().+?(\))) # Match title in parens… + | ((").+?(")) # or in quotes. + )? # Title is optional + \s* # Optional whitespace + (\)) + ) + scope: meta.image.inline.markdown + captures: + 1: punctuation.definition.string.begin.markdown + 2: string.other.link.description.markdown + 4: punctuation.definition.string.end.markdown + 5: invalid.illegal.whitespace.markdown + 6: punctuation.definition.metadata.markdown + 7: punctuation.definition.link.markdown + 8: markup.underline.link.image.markdown + 9: punctuation.definition.link.markdown + 10: string.other.link.description.title.markdown + 11: punctuation.definition.string.markdown + 12: punctuation.definition.string.markdown + 13: string.other.link.description.title.markdown + 14: punctuation.definition.string.markdown + 15: punctuation.definition.string.markdown + 16: punctuation.definition.metadata.markdown + image-reference: + - match: '\!(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*)(\])[ ]?(\[)(.*?)(\])' + scope: meta.image.reference.markdown + captures: + 1: punctuation.definition.string.begin.markdown + 2: string.other.link.description.markdown + 4: punctuation.definition.string.begin.markdown + 5: punctuation.definition.constant.markdown + 6: constant.other.reference.link.markdown + 7: punctuation.definition.constant.markdown + inline: + - include: escape + - include: ampersand + - include: bracket + - include: raw + - include: bold + - include: italic + - include: strike + - include: line-break + - include: image-inline + - include: link-inline + - include: link-inet + - include: link-email + - include: image-reference + - include: link-reference-literal + - include: link-reference + - include: latex-inline + italic: + - match: |- + (?x) + (\*|_)(?=\S) # Open + (?= + ( + <[^>]*+> # HTML tags + | (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> + # Raw + | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes + | \[ + ( + (?<square> # Named group + [^\[\]\\] # Match most chars + | \\. # Escaped chars + | \[ \g<square>*+ \] # Nested brackets + )*+ + \] + ( + ( # Reference Link + [ ]? # Optional space + \[[^\]]*+\] # Ref name + ) + | ( # Inline Link + \( # Opening paren + [^\S\n]*+ # Optional whtiespace + <?(.*?)>? # URL + [^\S\n]*+ # Optional whtiespace + ( # Optional Title + (?<title>['"]) + (.*?) + \k<title> + )? + \) + ) + ) + ) + | \1\1 # Must be bold closer + | (?!(?<=\S)\1). # Everything besides + # style closer + )++ + (?<=\S)\1 # Close + ) + captures: + 1: punctuation.definition.italic.markdown + push: + - meta_scope: markup.italic.markdown + - match: (?<=\S)(\1)((?!\1)|(?=\1\1)) + captures: + 1: punctuation.definition.italic.markdown + pop: true + - match: "(?=<[^>]*?>)" + push: + - include: scope:text.html.handlebars + - match: (?<=>) + pop: true + - include: escape + - include: ampersand + - include: bracket + - include: raw + - include: bold + - include: strike + - include: image-inline + - include: link-inline + - include: link-inet + - include: link-email + - include: image-reference + - include: link-reference-literal + - include: link-reference + line-break: + - match: " {2,}$" + scope: meta.dummy.line-break + link-email: + - match: '(<)((?:mailto:)?[-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(>)' + scope: meta.link.email.lt-gt.markdown + captures: + 1: punctuation.definition.link.markdown + 2: markup.underline.link.markdown + 4: punctuation.definition.link.markdown + link-inet: + - match: (<)((?:https?|ftp)://.*?)(>) + scope: meta.link.inet.markdown + captures: + 1: punctuation.definition.link.markdown + 2: markup.underline.link.markdown + 3: punctuation.definition.link.markdown + link-inline: + - match: |- + (?x: + (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) + # Match the link text. + ([ ])? # Space not allowed + (\() # Opening paren for url + (<?)(.*?)(>?) # The url + [^\S\n]* # Optional whitespace + (?: + ((\().+?(\))) # Match title in parens… + | ((").+?(")) # or in quotes. + )? # Title is optional + \s* # Optional whitespace + (\)) + ) + scope: meta.link.inline.markdown + captures: + 1: punctuation.definition.string.begin.markdown + 2: string.other.link.title.markdown + 4: punctuation.definition.string.end.markdown + 5: invalid.illegal.whitespace.markdown + 6: punctuation.definition.metadata.markdown + 7: punctuation.definition.link.markdown + 8: markup.underline.link.markdown + 9: punctuation.definition.link.markdown + 10: string.other.link.description.title.markdown + 11: punctuation.definition.string.begin.markdown + 12: punctuation.definition.string.end.markdown + 13: string.other.link.description.title.markdown + 14: punctuation.definition.string.begin.markdown + 15: punctuation.definition.string.end.markdown + 16: punctuation.definition.metadata.markdown + link-reference: + - match: '(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*)(\]) ?(\[)([^\]]*)(\])' + scope: meta.link.reference.markdown + captures: + 1: punctuation.definition.string.begin.markdown + 2: string.other.link.title.markdown + 4: punctuation.definition.string.end.markdown + 5: punctuation.definition.constant.begin.markdown + 6: constant.other.reference.link.markdown + 7: punctuation.definition.constant.end.markdown + link-reference-literal: + - match: '(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*)(\]) ?(\[)(\])' + scope: meta.link.reference.literal.markdown + captures: + 1: punctuation.definition.string.begin.markdown + 2: string.other.link.title.markdown + 4: punctuation.definition.string.end.markdown + 5: punctuation.definition.constant.begin.markdown + 6: punctuation.definition.constant.end.markdown + list-paragraph: + - match: \G\s+(?=\S) + push: + - meta_scope: meta.paragraph.list.markdown + - match: ^\s*$ + pop: true + - match: '^\s{0,4}([*+-]|([0-9]+)\.)(?=\s)' + captures: + 1: punctuation.definition.list_item.markdown + 2: punctuation.definition.list_item.number.markdown + - include: inline + raw: + - include: latex-display + - match: '(`+)([^`]|(?!(?<!`)\1(?!`))`)*+(\1)' + scope: markup.raw.inline.markdown + captures: + 1: punctuation.definition.raw.markdown + 3: punctuation.definition.raw.markdown + separator: + - match: '\G[ ]{,3}([-*_])([ ]{,2}\1){2,}[^\S\n]*$\n?' + scope: meta.separator.markdown + strike: + - match: |- + (?x) + (~~)(?=\S) # Open + (?= + ( + <[^>]*+> # HTML tags + | (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> + # Raw + | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes + | \[ + ( + (?<square> # Named group + [^\[\]\\] # Match most chars + | \\. # Escaped chars + | \[ \g<square>*+ \] # Nested brackets + )*+ + \] + ( + ( # Reference Link + [ ]? # Optional space + \[[^\]]*+\] # Ref name + ) + | ( # Inline Link + \( # Opening paren + [^\S\n]*+ # Optional whtiespace + <?(.*?)>? # URL + [^\S\n]*+ # Optional whtiespace + ( # Optional Title + (?<title>['"]) + (.*?) + \k<title> + )? + \) + ) + ) + ) + | \1\1 # Must be bold closer + | (?!(?<=\S)\1). # Everything besides + # style closer + )++ + (?<=\S)\1 # Close + ) + captures: + 1: punctuation.definition.strike.markdown + push: + - meta_scope: markup.strike.markdown + - match: (?<=\S)(\1)((?!\1)|(?=\1\1)) + captures: + 1: punctuation.definition.strike.markdown + pop: true + - match: "(?=<[^>]*?>)" + push: + - include: scope:text.html.handlebars + - match: (?<=>) + pop: true + - include: escape + - include: ampersand + - include: bracket + - include: raw + - include: bold + - include: italic + - include: image-inline + - include: link-inline + - include: link-inet + - include: link-email + - include: image-reference + - include: link-reference-literal + - include: link-reference + + latex-inline: + - match: \\\$ + - match: |- + (?x) + (\$)(?=[^\s\$]) + (?= + (?: + \\\\ + |\\\$ + |[^\$] + )*? + \S\$(?:[^a-zA-Z0-9]|$) + ) + scope: string.other.math.latex punctuation.definition.string.begin.latex + push: + - meta_scope: text.tex.latex meta.environment.math.latex + - include: scope:text.tex.latex#macros + - include: scope:text.tex.latex#math-content + - match: \$ + scope: string.other.math.latex punctuation.definition.string.end.latex + pop: true + + latex-display: + - match: \$\$ + scope: string.other.math.latex punctuation.definition.string.begin.latex + push: + - meta_scope: text.tex.latex meta.environment.math.latex + - include: scope:text.tex.latex#macros + - include: scope:text.tex.latex#math-content + - match: \$\$ + scope: string.other.math.latex punctuation.definition.string.end.latex + pop: true