diff --git a/Markdown (Github Flavored).tmLanguage b/Markdown (Github Flavored).tmLanguage index fdb4761..6b94d52 100644 --- a/Markdown (Github Flavored).tmLanguage +++ b/Markdown (Github Flavored).tmLanguage @@ -90,94 +90,241 @@ begin - (```)\s*(html|html5)\s*$ + ^[ ]{0,3}([*+-])(?=\s) captures 1 name - punctuation.definition.fenced.markdown - - 2 - - name - variable.language.fenced.markdown + punctuation.definition.list_item.markdown end - (\1)\n + ^(?=\S) name - markup.raw.block.markdown markup.raw.block.fenced.markdown + markup.list.unnumbered.markdown patterns include - text.html.basic + #list-paragraph begin - (```)\s*(xml)\s*$ + ^[ ]{0,3}([0-9]+)(\.)(?=\s) captures 1 name - punctuation.definition.fenced.markdown + punctuation.definition.list_item.markdown punctuation.definition.list_item.number.markdown 2 name - variable.language.fenced.markdown + punctuation.definition.list_item.markdown end - (\1)\n + ^(?=\S) name - markup.raw.block.markdown markup.raw.block.fenced.markdown + markup.list.numbered.markdown patterns include - text.xml + #list-paragraph + + + + + + begin + ^(?=<(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. + + end + (?<=^</\1>$\n) + name + meta.disable-markdown + patterns + + + include + text.html.basic begin - (```)\s*(diff)\s*$ + ^(?=<(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. + end + $\n? + name + meta.disable-markdown + patterns + + + include + text.html.basic + + + + + captures 1 name - punctuation.definition.fenced.markdown + 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 - variable.language.fenced.markdown + 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 + + + + begin + ^(?=\S)(?![=-]{3,}(?=$)) end - (\1)\n + ^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ \t]*\n|(?=^#) name - markup.raw.block.markdown markup.raw.block.fenced.markdown + meta.paragraph.markdown patterns include - source.diff + #inline + + + include + text.html.basic + + + captures + + 1 + + name + punctuation.definition.heading.markdown + + + match + ^(={3,})(?=[ \t]*$) + name + markup.heading.1.markdown + + + captures + + 1 + + name + punctuation.definition.heading.markdown + + + match + ^(-{3,})(?=[ \t]*$) + name + markup.heading.2.markdown + + + + + + repository + + fenced-html begin - (```)\s*(perl)\s*$ + (\s*```)\s*(html|html5)\s*$ captures 1 @@ -199,14 +346,14 @@ include - source.perl + text.html.basic - + fenced-xml begin - (```)\s*(php)\s*$ + (\s*```)\s*(xml)\s*$ captures 1 @@ -228,15 +375,14 @@ include - source.php + text.xml - - + fenced-diff begin - (```)\s*(css)\s*$ + (\s*```)\s*(diff)\s*$ captures 1 @@ -258,14 +404,14 @@ include - source.css + source.diff - + fenced-perl begin - (```)\s*(less)\s*$ + (\s*```)\s*(perl)\s*$ captures 1 @@ -287,14 +433,14 @@ include - source.css.less + source.perl - + fenced-php begin - (```)\s*(java)\s*$ + (\s*```)\s*(php)\s*$ captures 1 @@ -316,14 +462,14 @@ include - source.java + source.php - + fenced-css begin - (```)\s*(c)\s*$ + (\s*```)\s*(css)\s*$ captures 1 @@ -345,15 +491,14 @@ include - source.c + source.css - - + fenced-less begin - (```)\s*(c\+\+)\s*$ + (\s*```)\s*(less)\s*$ captures 1 @@ -375,14 +520,14 @@ include - source.c++ + source.css.less - + fenced-java begin - (```)\s*(yaml)\s*$ + (\s*```)\s*(java)\s*$ captures 1 @@ -404,14 +549,14 @@ include - source.yaml + source.java - + fenced-c begin - (```)\s*(sql)\s*$ + (\s*```)\s*(c)\s*$ captures 1 @@ -433,14 +578,14 @@ include - source.sql + source.c - + fenced-c++ begin - (```)\s*(shell)\s*$ + (\s*```)\s*(c\+\+)\s*$ captures 1 @@ -462,14 +607,14 @@ include - source.shell + source.c++ - + fenced-yaml begin - (```)\s*(sass|scss)\s*$ + (\s*```)\s*(yaml)\s*$ captures 1 @@ -491,14 +636,14 @@ include - source.sass + source.yaml - + fenced-sql begin - (```)\s*(scala)\s*$ + (\s*```)\s*(sql)\s*$ captures 1 @@ -520,14 +665,14 @@ include - source.scala + source.sql - + fenced-shell begin - (```)\s*(objective-c)\s*$ + (\s*```)\s*(shell)\s*$ captures 1 @@ -549,14 +694,14 @@ include - source.objc + source.shell - + fenced-sass begin - (```)\s*(python)\s*$ + (\s*```)\s*(sass|scss)\s*$ captures 1 @@ -578,14 +723,14 @@ include - source.python + source.sass - + fenced-scala begin - (```)\s*(coffee)\s*$ + (\s*```)\s*(scala)\s*$ captures 1 @@ -607,14 +752,14 @@ include - source.coffee + source.scala - + fenced-obj-c begin - (```)\s*(js|json|javascript)\s*$ + (\s*```)\s*(objective-c)\s*$ captures 1 @@ -636,14 +781,14 @@ include - source.js + source.objc - + fenced-coffee begin - (```)\s*(ruby)\s*$ + (\s*```)\s*(coffee)\s*$ captures 1 @@ -665,14 +810,14 @@ include - source.ruby + source.coffee - + fenced-js begin - (```)\s*(\w*)\s*$ + (\s*```)\s*(js|json|javascript)\s*$ captures 1 @@ -690,242 +835,95 @@ (\1)\n name markup.raw.block.markdown markup.raw.block.fenced.markdown - - - - begin - ^[ ]{0,3}([*+-])(?=\s) - captures - - 1 - - name - punctuation.definition.list_item.markdown - - - end - ^(?=\S) - name - markup.list.unnumbered.markdown patterns include - #list-paragraph + source.js - + fenced-ruby begin - ^[ ]{0,3}([0-9]+)(\.)(?=\s) + (\s*```)\s*(ruby)\s*$ captures 1 name - punctuation.definition.list_item.markdown punctuation.definition.list_item.number.markdown + punctuation.definition.fenced.markdown 2 name - punctuation.definition.list_item.markdown + variable.language.fenced.markdown end - ^(?=\S) + (\1)\n name - markup.list.numbered.markdown + markup.raw.block.markdown markup.raw.block.fenced.markdown patterns include - #list-paragraph + source.ruby - + fenced-python begin - ^(?=<(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. - - end - (?<=^</\1>$\n) - name - meta.disable-markdown - patterns - + (\s*```)\s*(python)\s*$ + captures + + 1 - include - text.html.basic + name + punctuation.definition.fenced.markdown - - - - - begin - ^(?=<(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. + 2 + + name + variable.language.fenced.markdown + + end - $\n? + (\1)\n name - meta.disable-markdown + markup.raw.block.markdown markup.raw.block.fenced.markdown patterns include - text.html.basic + source.python - + fenced-undefine + begin + (\s*```)\s*(\w*)\s*$ 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 + punctuation.definition.fenced.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 + variable.language.fenced.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 - - - - begin - ^(?=\S)(?![=-]{3,}(?=$)) end - ^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ \t]*\n|(?=^#) + (\1)\n name - meta.paragraph.markdown - patterns - - - include - #inline - - - include - text.html.basic - - - captures - - 1 - - name - punctuation.definition.heading.markdown - - - match - ^(={3,})(?=[ \t]*$) - name - markup.heading.1.markdown - - - captures - - 1 - - name - punctuation.definition.heading.markdown - - - match - ^(-{3,})(?=[ \t]*$) - name - markup.heading.2.markdown - - + markup.raw.block.markdown markup.raw.block.fenced.markdown - - - - - - repository - - ampersand comment @@ -1036,7 +1034,7 @@ block_raw match - \G([ ]{4}|\t).*$\n? + ([ ]{4}|\t).*$\n? name markup.raw.block.markdown @@ -1240,6 +1238,90 @@ patterns + + include + #fenced-html + + + include + #fenced-xml + + + include + #fenced-diff + + + include + #fenced-perl + + + include + #fenced-php + + + include + #fenced-css + + + include + #fenced-less + + + include + #fenced-java + + + include + #fenced-c + + + include + #fenced-c++ + + + include + #fenced-yaml + + + include + #fenced-sql + + + include + #fenced-shell + + + include + #fenced-sass + + + include + #fenced-scala + + + include + #fenced-obj-c + + + include + #fenced-coffee + + + include + #fenced-js + + + include + #fenced-ruby + + + include + #fenced-python + + + include + #fenced-undefine + include #escape @@ -1702,7 +1784,6 @@ - include #inline