fileTypes md mdown markdown markdn firstLineMatch ^# \[Think different\]\[\] keyEquivalent ^~M name Markdown patterns include #block repository block patterns include #separator include #heading include #blockquote include #lists include #raw_block include #link-def include #html include #paragraph repository blockquote begin (^|\G)[ ]{0,3}(>) ? captures 2 name punctuation.definition.quote.markdown name markup.quote.markdown patterns include #block while (^|\G)[ ]{0,3}(>) ? heading begin (?:^|\G)(#{1,6})\s*(?=[\S[^#]]) captures 1 name punctuation.definition.heading.markdown contentName entity.name.section.markdown end \s*(#{1,6})?$\n? name markup.heading.${1/(#)(#)?(#)?(#)?(#)?(#)?/${6:?6:${5:?5:${4:?4:${3:?3:${2:?2:1}}}}}/}.markdown patterns include #inline heading-setext patterns match ^(={3,})(?=[ \t]*$\n?) name markup.heading.setext.1.markdown match ^(-{3,})(?=[ \t]*$\n?) name markup.heading.setext.2.markdown html patterns begin (?i)(^|\G)(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del).*</\2\s*>\s*$) end $ patterns include text.html.basic begin (?i)(^|\G)(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)) patterns include text.html.basic while \G(?!</\2\s*>) link-def 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 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 $ ) name meta.link.reference.def.markdown list_paragraph begin (^|\G)(?=\S)(?![*+-]\s|[0-9]+\.\s) name meta.paragraph.markdown patterns include #inline include text.html.basic include #heading-setext while (^|\G)(?!\s*$|#|[ ]{0,3}([-*_][ ]{2,}){3,}[ \t]*$\n?|>|[ ]{0,3}[*+-]|[ ]{0,3}[0-9]+\.) lists patterns begin (^|\G)([ ]{0,3})([*+-])([ ]{1,3}|\t) beginCaptures 3 name punctuation.definition.list.markdown comment Currently does not support un-indented second lines. name markup.list.unnumbered.markdown patterns include #list_paragraph include #block while \G([ ]{4}|\t|$) begin (^|\G)([ ]{0,3})([0-9]+\.)([ ]{1,3}|\t) beginCaptures 3 name punctuation.definition.list.markdown name markup.list.numbered.markdown patterns include #list_paragraph include #block while \G([ ]{4}|\t|$) paragraph begin (^|\G)(?=\S) name meta.paragraph.markdown patterns include #inline include text.html.basic include #heading-setext while (^|\G)(?!\s*$|#|[ ]{0,3}([-*_][ ]{2,}){3,}[ \t]*$\n?|\s*\[.+?\]:|>) raw_block begin (^|\G)([ ]{4}|\t) name markup.raw.block.markdown while (^|\G)([ ]{4}|\t) separator match (^|\G)[ ]{0,3}([-*_])([ ]{0,2}\2){2,}[ \t]*$\n? name meta.separator.markdown inline patterns include #ampersand include #bracket include #bold include #italic include #raw include #escape include #image-inline include #image-ref include #link-email include #link-inet include #link-inline include #link-ref include #link-ref-literal repository 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]+);) name meta.other.valid-ampersand.markdown bold 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 ) captures 1 name punctuation.definition.bold.markdown end (?<=\S)(\1) name markup.bold.markdown patterns applyEndPatternLast 1 begin (?=<[^>]*?>) end (?<=>) patterns include text.html.basic 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 Markdown will convert this for us. We match it so that the HTML grammar will not mark it up as invalid. match <(?![a-z/?\$!]) name meta.other.valid-bracket.markdown escape match \\[-`*_#+.!(){}\[\]\\>] name constant.character.escape.markdown image-inline 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 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 match (?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… | ((["']).+?(\14)) # or in quotes. )? # Title is optional \s* # Optional whitespace (\)) ) name meta.image.inline.markdown image-ref 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 match \!(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(.*?)(\]) name meta.image.reference.markdown italic 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 ) captures 1 name punctuation.definition.italic.markdown end (?<=\S)(\1)((?!\1)|(?=\1\1)) name markup.italic.markdown patterns applyEndPatternLast 1 begin (?=<[^>]*?>) end (?<=>) patterns include text.html.basic 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 link-email captures 1 name punctuation.definition.link.markdown 2 name markup.underline.link.markdown 4 name punctuation.definition.link.markdown match (<)((?:mailto:)?[-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(>) name meta.link.email.lt-gt.markdown link-inet captures 1 name punctuation.definition.link.markdown 2 name markup.underline.link.markdown 3 name punctuation.definition.link.markdown match (<)((?:https?|ftp)://.*?)(>) name meta.link.inet.markdown link-inline 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 match (?x: (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) # Match the link text. ([ ])? # Space not allowed (\() # Opening paren for url (<?)(.*?)(>?) # The url [ \t]* # Optional whitespace (?: ((\().+?(\))) # Match title in parens… | ((["']).+?(\14)) # or in quotes. )? # Title is optional \s* # Optional whitespace (\)) ) name meta.link.inline.markdown link-ref 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 match (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)([^\]]*+)(\]) name meta.link.reference.markdown link-ref-literal 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 match (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(\]) name meta.link.reference.literal.markdown raw captures 1 name punctuation.definition.raw.markdown 2 3 name punctuation.definition.raw.markdown match (`+)([^`]|(?!(?<!`)\1(?!`))`)*+(\1) name markup.raw.inline.markdown scopeName text.html.markdown uuid 0A1D9874-B448-11D9-BD50-000D93B6E43C