{ "name": "CoffeeScript (Literate)", "scopeName": "source.litcoffee", "patterns": [ { "name": "markup.raw.block.markdown", "begin": "^(?=([ ]{4}|\\t)(?!$))", "end": "^(?!([ ]{4}|\\t))", "patterns": [ { "include": "#block_raw" } ] }, { "name": "meta.block-level.markdown", "begin": "(?x)^\n(?= [ ]{0,3}\u003e.\n| [#]{1,6}\\s*+\n| [ ]{0,3}(?\u003cmarker\u003e[-*_])([ ]{0,2}\\k\u003cmarker\u003e){2,}[ \\t]*+$\n)", "end": "(?x)^\n(?! [ ]{0,3}\u003e.\n| [#]{1,6}\\s*+\n| [ ]{0,3}(?\u003cmarker\u003e[-*_])([ ]{0,2}\\k\u003cmarker\u003e){2,}[ \\t]*+$\n)", "patterns": [ { "include": "#block_quote" }, { "include": "#heading" }, { "include": "#separator" } ] }, { "name": "markup.list.unnumbered.markdown", "begin": "^[ ]{0,3}([*+-])(?=\\s)", "end": "^(?=\\S|[ ]{4,})|(?!\\G)", "patterns": [ { "include": "#list-paragraph" } ], "captures": { "1": { "name": "punctuation.definition.list_item.markdown" } } }, { "name": "markup.list.numbered.markdown", "begin": "^[ ]{0,3}([0-9]+\\.)(?=\\s)", "end": "^(?=\\S|[ ]{4,})|(?!\\G)", "patterns": [ { "include": "#list-paragraph" } ], "captures": { "1": { "name": "punctuation.definition.list_item.markdown" } } }, { "name": "meta.disable-markdown", "begin": "^(?=\u003c(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\\b)(?!.*?\u003c/\\1\u003e)", "end": "(?\u003c=^\u003c/\\1\u003e$\\n)", "patterns": [ { "include": "text.html.basic" } ] }, { "name": "meta.disable-markdown", "begin": "^(?=\u003c(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" } ] }, { "name": "meta.link.reference.def.markdown", "match": "(?x)\n\\s* # Leading whitespace\n(\\[)(.+?)(\\])(:) # Reference name\n[ \\t]* # Optional whitespace\n(\u003c?)(\\S+?)(\u003e?) # The url\n[ \\t]* # Optional whitespace\n(?:\n ((\\().+?(\\))) # Match title in quotes…\n | ((\").+?(\")) # or in parens.\n)? # Title is optional\n\\s* # Optional whitespace\n$", "captures": { "1": { "name": "punctuation.definition.constant.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" }, "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" } } }, { "name": "meta.paragraph.markdown", "begin": "^(?=\\S)(?![=-]{3,}(?=$))", "end": "^(?:\\s*$|(?=[ ]{0,3}\u003e.))|(?=[ \\t]*\\n)(?\u003c=^===|^====|=====|^---|^----|-----)[ \\t]*\\n|(?=^#)", "patterns": [ { "include": "#inline" }, { "include": "text.html.basic" }, { "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": { "name": "meta.other.valid-ampersand.markdown", "match": "\u0026(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)" }, "block_quote": { "name": "markup.quote.markdown", "begin": "\\G[ ]{0,3}(\u003e)(?!$)[ ]?", "end": "(?x)^\n(?= \\s*$\n| [ ]{0,3}(?\u003cmarker\u003e[-*_])([ ]{0,2}\\k\u003cmarker\u003e){2,}[ \\t]*+$\n| [ ]{0,3}\u003e.\n)", "patterns": [ { "begin": "(?x)\\G\n(?= [ ]{0,3}\u003e.\n)", "end": "^", "patterns": [ { "include": "#block_quote" } ] }, { "begin": "(?x)\\G\n(?= ([ ]{4}|\\t)\n| [#]{1,6}\\s*+\n| [ ]{0,3}(?\u003cmarker\u003e[-*_])([ ]{0,2}\\k\u003cmarker\u003e){2,}[ \\t]*+$\n)", "end": "^", "patterns": [ { "include": "#block_raw" }, { "include": "#heading" }, { "include": "#separator" } ], "applyEndPatternLast": true }, { "begin": "(?x)\\G\n(?! $\n| [ ]{0,3}\u003e.\n| ([ ]{4}|\\t)\n| [#]{1,6}\\s*+\n| [ ]{0,3}(?\u003cmarker\u003e[-*_])([ ]{0,2}\\k\u003cmarker\u003e){2,}[ \\t]*+$\n)", "end": "$|(?\u003c=\\n)", "patterns": [ { "include": "#inline" } ] } ], "beginCaptures": { "1": { "name": "punctuation.definition.blockquote.markdown" } } }, "block_raw": { "name": "markup.raw.block.markdown", "patterns": [ { "include": "#coffee_script" } ] }, "bold": { "name": "markup.bold.markdown", "begin": "(?x)\n(\\*\\*|__)(?=\\S) # Open\n(?=\n (\n \u003c[^\u003e]*+\u003e # HTML tags\n | (?\u003craw\u003e`+)([^`]|(?!(?\u003c!`)\\k\u003craw\u003e(?!`))`)*+\\k\u003craw\u003e # Raw\n | \\\\[\\\\`*_{}\\[\\]()#.!+\\-\u003e]?+ # Escapes\n | \\[\n (\n (?\u003csquare\u003e # Named group\n [^\\[\\]\\\\] # Match most chars\n | \\\\. # Escaped chars\n | \\[ \\g\u003csquare\u003e*+ \\] # Nested brackets\n )*+\n \\]\n (\n ( # Reference Link\n [ ]? # Optional space\n \\[[^\\]]*+\\] # Ref name\n )\n |\n ( # Inline Link\n \\( # Opening paren\n [ \\t]*+ # Optional whitespace\n \u003c?(.*?)\u003e? # URL\n [ \\t]*+ # Optional whitespace\n ( # Optional Title\n (?\u003ctitle\u003e['\"])\n (.*?)\n \\k\u003ctitle\u003e\n )?\n \\)\n )\n )\n )\n | (?!(?\u003c=\\S)\\1). # Everything besides\n )++\n (?\u003c=\\S)\\1 # Close\n)", "end": "(?\u003c=\\S)(\\1)", "patterns": [ { "begin": "(?=\u003c[^\u003e]*?\u003e)", "end": "(?\u003c=\u003e)", "patterns": [ { "include": "text.html.basic" } ], "applyEndPatternLast": true }, { "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" } ], "captures": { "1": { "name": "punctuation.definition.bold.markdown" } } }, "bracket": { "name": "meta.other.valid-bracket.markdown", "match": "\u003c(?![a-z/?\\$!])" }, "coffee_script": { "patterns": [ { "include": "source.coffee" } ] }, "escape": { "name": "constant.character.escape.markdown", "match": "\\\\[-`*_#+.!(){}\\[\\]\\\\\u003e]" }, "heading": { "name": "markup.heading.markdown", "contentName": "entity.name.section.markdown", "begin": "\\G(#{1,6})(?!#)\\s*(?=\\S)", "end": "\\s*(#*)$\\n?", "patterns": [ { "include": "#inline" } ], "captures": { "1": { "name": "punctuation.definition.heading.markdown" } } }, "image-inline": { "name": "meta.image.inline.markdown", "match": "(?x)\n\\! # Images start with !\n(\\[)((?\u003csquare\u003e[^\\[\\]\\\\]|\\\\.|\\[\\g\u003csquare\u003e*+\\])*+)(\\]) # Match the link text\n([ ])? # Space not allowed\n(\\() # Opening paren for url\n(\u003c?)(\\S+?)(\u003e?) # The url\n[ \\t]* # Optional whitespace\n(?:\n ((\\().+?(\\))) # Match title in parens…\n | ((\").+?(\")) # or in quotes.\n)? # Title is optional\n\\s* # Optional whitespace\n(\\))", "captures": { "1": { "name": "punctuation.definition.string.begin.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" }, "2": { "name": "string.other.link.description.markdown" }, "3": { "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" } } }, "image-ref": { "name": "meta.image.reference.markdown", "match": "\\!(\\[)((?\u003csquare\u003e[^\\[\\]\\\\]|\\\\.|\\[\\g\u003csquare\u003e*+\\])*+)(\\])[ ]?(\\[)(.*?)(\\])", "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)\n(\\*|_)(?=\\S) # Open\n(?=\n (\n \u003c[^\u003e]*+\u003e # HTML tags\n | (?\u003craw\u003e`+)([^`]|(?!(?\u003c!`)\\k\u003craw\u003e(?!`))`)*+\\k\u003craw\u003e # Raw\n | \\\\[\\\\`*_{}\\[\\]()#.!+\\-\u003e]?+ # Escapes\n | \\[\n (\n (?\u003csquare\u003e # Named group\n [^\\[\\]\\\\] # Match most chars\n | \\\\. # Escaped chars\n | \\[ \\g\u003csquare\u003e*+ \\] # Nested brackets\n )*+\n \\]\n (\n ( # Reference Link\n [ ]? # Optional space\n \\[[^\\]]*+\\] # Ref name\n )\n |\n ( # Inline Link\n \\( # Opening paren\n [ \\t]*+ # Optional whitespace\n \u003c?(.*?)\u003e? # URL\n [ \\t]*+ # Optional whitespace\n ( # Optional Title\n (?\u003ctitle\u003e['\"])\n (.*?)\n \\k\u003ctitle\u003e\n )?\n \\)\n )\n )\n )\n | \\1\\1 # Must be bold closer\n | (?!(?\u003c=\\S)\\1). # Everything besides\n )++\n (?\u003c=\\S)\\1 # Close\n)", "end": "(?\u003c=\\S)(\\1)((?!\\1)|(?=\\1\\1))", "patterns": [ { "begin": "(?=\u003c[^\u003e]*?\u003e)", "end": "(?\u003c=\u003e)", "patterns": [ { "include": "text.html.basic" } ], "applyEndPatternLast": true }, { "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" } ], "captures": { "1": { "name": "punctuation.definition.italic.markdown" } } }, "line-break": { "name": "meta.dummy.line-break", "match": " {2,}$" }, "link-email": { "name": "meta.link.email.lt-gt.markdown", "match": "(\u003c)((?:mailto:)?[-.\\w]+@[-a-z0-9]+(\\.[-a-z0-9]+)*\\.[a-z]+)(\u003e)", "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": "(\u003c)((?:https?|ftp)://.*?)(\u003e)", "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(\\[)((?\u003csquare\u003e[^\\[\\]\\\\]|\\\\.|\\[\\g\u003csquare\u003e*+\\])*+)(\\]) # Match the link text.\n([ ])? # Space not allowed\n(\\() # Opening paren for url\n(\u003c?)(.*?)(\u003e?) # The url\n[ \\t]* # Optional whitespace\n(?:\n ((\\().+?(\\))) # Match title in parens…\n | ((\").+?(\")) # or in quotes.\n)? # Title is optional\n\\s* # Optional whitespace\n(\\))", "captures": { "1": { "name": "punctuation.definition.string.begin.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" }, "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" } } }, "link-ref": { "name": "meta.link.reference.markdown", "match": "(\\[)((?\u003csquare\u003e[^\\[\\]\\\\]|\\\\.|\\[\\g\u003csquare\u003e*+\\])*+)(\\])[ ]?(\\[)([^\\]]*+)(\\])", "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": "(\\[)((?\u003csquare\u003e[^\\[\\]\\\\]|\\\\.|\\[\\g\u003csquare\u003e*+\\])*+)(\\])[ ]?(\\[)(\\])", "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" }, { "match": "^\\s*([*+-]|[0-9]+\\.)", "captures": { "1": { "name": "punctuation.definition.list_item.markdown" } } } ] } ] }, "raw": { "name": "markup.raw.inline.markdown", "match": "(`+)([^`]|(?!(?\u003c!`)\\1(?!`))`)*+(\\1)", "captures": { "1": { "name": "punctuation.definition.raw.markdown" }, "3": { "name": "punctuation.definition.raw.markdown" } } }, "separator": { "name": "meta.separator.markdown", "match": "\\G[ ]{0,3}([-*_])([ ]{0,2}\\1){2,}[ \\t]*$\\n?" } } }