textpow 0.10.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +7 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +30 -0
- data/{History.txt → History.rdoc} +10 -0
- data/{README.txt → MIT-LICENSE.txt} +0 -30
- data/README.rdoc +82 -0
- data/Rakefile +42 -49
- data/bin/plist2syntax +0 -0
- data/bin/plist2yaml +0 -0
- data/examples/benchmark_js.rb +13 -0
- data/examples/jquery.js +9046 -0
- data/lib/textpow.rb +43 -3
- data/lib/textpow/debug_processor.rb +35 -35
- data/lib/textpow/recording_processor.rb +13 -0
- data/lib/textpow/score_manager.rb +60 -60
- data/lib/textpow/syntax.rb +303 -262
- data/lib/textpow/syntax/broken/markdown.syntax +519 -0
- data/lib/textpow/syntax/broken/php.syntax +1253 -0
- data/lib/textpow/syntax/buggy/nemerle.syntax +74 -0
- data/lib/textpow/syntax/old/YAML.yaml +160 -0
- data/lib/textpow/syntax/old/txt2tags.yaml +139 -0
- data/lib/textpow/syntax/source.actionscript.syntax +97 -0
- data/lib/textpow/syntax/source.active4d.library.syntax +21 -0
- data/lib/textpow/syntax/source.active4d.syntax +276 -0
- data/lib/textpow/syntax/source.ada.syntax +33 -0
- data/lib/textpow/syntax/source.antlr.syntax +151 -0
- data/lib/textpow/syntax/source.apache-config.mod_perl.syntax +50 -0
- data/lib/textpow/syntax/source.apache-config.syntax +191 -0
- data/lib/textpow/syntax/source.applescript.syntax +384 -0
- data/lib/textpow/syntax/source.asp.syntax +70 -0
- data/lib/textpow/syntax/source.asp.vb.net.syntax +129 -0
- data/lib/textpow/syntax/source.c++.qt.syntax +26 -0
- data/lib/textpow/syntax/source.c++.syntax +186 -0
- data/lib/textpow/syntax/source.c-sharp.syntax +59 -0
- data/lib/textpow/syntax/source.c.ragel.syntax +201 -0
- data/lib/textpow/syntax/source.c.syntax +414 -0
- data/lib/textpow/syntax/source.camlp4.ocaml.syntax +36 -0
- data/lib/textpow/syntax/source.cm.syntax +32 -0
- data/lib/textpow/syntax/source.coffee.syntax +216 -0
- data/lib/textpow/syntax/source.context-free.syntax +176 -0
- data/lib/textpow/syntax/source.css.beta.syntax +1925 -0
- data/lib/textpow/syntax/source.css.syntax +195 -0
- data/lib/textpow/syntax/source.d.syntax +142 -0
- data/lib/textpow/syntax/source.diff.syntax +81 -0
- data/lib/textpow/syntax/source.dot.syntax +47 -0
- data/lib/textpow/syntax/source.dylan.syntax +62 -0
- data/lib/textpow/syntax/source.eiffel.syntax +78 -0
- data/lib/textpow/syntax/source.erlang.syntax +922 -0
- data/lib/textpow/syntax/source.fortran.syntax +141 -0
- data/lib/textpow/syntax/source.fscript.syntax +80 -0
- data/lib/textpow/syntax/source.fxscript.syntax +142 -0
- data/lib/textpow/syntax/source.gri.syntax +83 -0
- data/lib/textpow/syntax/source.groovy.groovy.syntax +191 -0
- data/lib/textpow/syntax/source.haskell.syntax +88 -0
- data/lib/textpow/syntax/source.icalendar.syntax +32 -0
- data/lib/textpow/syntax/source.inform.syntax +48 -0
- data/lib/textpow/syntax/source.ini.syntax +55 -0
- data/lib/textpow/syntax/source.io.syntax +81 -0
- data/lib/textpow/syntax/source.java-props.syntax +20 -0
- data/lib/textpow/syntax/source.java.syntax +211 -0
- data/lib/textpow/syntax/source.js.greasemonkey.syntax +34 -0
- data/lib/textpow/syntax/source.js.jquery.syntax +114 -0
- data/lib/textpow/syntax/source.js.mootools.syntax +572 -0
- data/lib/textpow/syntax/source.js.prototype.bracketed.syntax +140 -0
- data/lib/textpow/syntax/source.js.prototype.syntax +72 -0
- data/lib/textpow/syntax/source.js.syntax +256 -0
- data/lib/textpow/syntax/source.js.yui.syntax +176 -0
- data/lib/textpow/syntax/source.json.syntax +136 -0
- data/lib/textpow/syntax/source.lex.syntax +219 -0
- data/lib/textpow/syntax/source.lighttpd-config.syntax +54 -0
- data/lib/textpow/syntax/source.lilypond.syntax +492 -0
- data/lib/textpow/syntax/source.lisp.syntax +61 -0
- data/lib/textpow/syntax/source.logo.syntax +29 -0
- data/lib/textpow/syntax/source.logtalk.syntax +152 -0
- data/lib/textpow/syntax/source.lua.syntax +86 -0
- data/lib/textpow/syntax/source.makefile.syntax +36 -0
- data/lib/textpow/syntax/source.matlab.syntax +142 -0
- data/lib/textpow/syntax/source.mel.syntax +92 -0
- data/lib/textpow/syntax/source.mips.syntax +66 -0
- data/lib/textpow/syntax/source.ml.syntax +121 -0
- data/lib/textpow/syntax/source.modula-3.syntax +47 -0
- data/lib/textpow/syntax/source.nant-build.syntax +53 -0
- data/lib/textpow/syntax/source.objc++.syntax +18 -0
- data/lib/textpow/syntax/source.objc.syntax +233 -0
- data/lib/textpow/syntax/source.ocaml.syntax +764 -0
- data/lib/textpow/syntax/source.ocamllex.syntax +167 -0
- data/lib/textpow/syntax/source.ocamlyacc.syntax +184 -0
- data/lib/textpow/syntax/source.open-gl.syntax +14 -0
- data/lib/textpow/syntax/source.pascal.syntax +77 -0
- data/lib/textpow/syntax/source.pascal.vectorscript.syntax +57 -0
- data/lib/textpow/syntax/source.perl.syntax +1113 -0
- data/lib/textpow/syntax/source.php.cake.syntax +55 -0
- data/lib/textpow/syntax/source.plist.tm-grammar.syntax +708 -0
- data/lib/textpow/syntax/source.postscript.syntax +114 -0
- data/lib/textpow/syntax/source.processing.syntax +106 -0
- data/lib/textpow/syntax/source.prolog.syntax +40 -0
- data/lib/textpow/syntax/source.python.django.syntax +21 -0
- data/lib/textpow/syntax/source.python.syntax +868 -0
- data/lib/textpow/syntax/source.qmake.syntax +114 -0
- data/lib/textpow/syntax/source.quake-config.syntax +32 -0
- data/lib/textpow/syntax/source.r-console.syntax +16 -0
- data/lib/textpow/syntax/source.r.syntax +81 -0
- data/lib/textpow/syntax/source.regexp.oniguruma.syntax +107 -0
- data/lib/textpow/syntax/source.regexp.python.syntax +109 -0
- data/lib/textpow/syntax/source.regexp.syntax +50 -0
- data/lib/textpow/syntax/source.remind.syntax +253 -0
- data/lib/textpow/syntax/source.rez.syntax +80 -0
- data/lib/textpow/syntax/source.ruby.experimental.syntax +145 -0
- data/lib/textpow/syntax/source.ruby.rails.syntax +88 -0
- data/lib/textpow/syntax/source.ruby.syntax +1035 -0
- data/lib/textpow/syntax/source.s5.syntax +69 -0
- data/lib/textpow/syntax/source.sass.syntax +45 -0
- data/lib/textpow/syntax/source.scheme.syntax +347 -0
- data/lib/textpow/syntax/source.scilab.syntax +41 -0
- data/lib/textpow/syntax/source.scss.syntax +527 -0
- data/lib/textpow/syntax/source.shell.syntax +384 -0
- data/lib/textpow/syntax/source.slate.syntax +149 -0
- data/lib/textpow/syntax/source.smarty.syntax +63 -0
- data/lib/textpow/syntax/source.sql.ruby.syntax +18 -0
- data/lib/textpow/syntax/source.sql.syntax +237 -0
- data/lib/textpow/syntax/source.ssh-config.syntax +33 -0
- data/lib/textpow/syntax/source.strings.syntax +39 -0
- data/lib/textpow/syntax/source.swig.syntax +57 -0
- data/lib/textpow/syntax/source.tcl.macports.syntax +163 -0
- data/lib/textpow/syntax/source.tcl.syntax +152 -0
- data/lib/textpow/syntax/source.yaml.syntax +160 -0
- data/lib/textpow/syntax/text.active4d-ini.syntax +50 -0
- data/lib/textpow/syntax/text.bbcode.syntax +287 -0
- data/lib/textpow/syntax/text.bibtex.syntax +151 -0
- data/lib/textpow/syntax/text.blog.html.syntax +41 -0
- data/lib/textpow/syntax/text.blog.markdown.syntax +42 -0
- data/lib/textpow/syntax/text.blog.syntax +27 -0
- data/lib/textpow/syntax/text.blog.textile.syntax +27 -0
- data/lib/textpow/syntax/text.gtdalt.syntax +143 -0
- data/lib/textpow/syntax/text.haml.syntax +88 -0
- data/lib/textpow/syntax/text.html.asp.net.syntax +424 -0
- data/lib/textpow/syntax/text.html.asp.syntax +27 -0
- data/lib/textpow/syntax/text.html.basic.syntax +362 -0
- data/lib/textpow/syntax/text.html.cfm.syntax +119 -0
- data/lib/textpow/syntax/text.html.django.syntax +36 -0
- data/lib/textpow/syntax/text.html.dokuwiki.syntax +204 -0
- data/lib/textpow/syntax/text.html.doxygen.syntax +43 -0
- data/lib/textpow/syntax/text.html.markdown.multimarkdown.syntax +39 -0
- data/lib/textpow/syntax/text.html.mason.syntax +119 -0
- data/lib/textpow/syntax/text.html.mediawiki.syntax +567 -0
- data/lib/textpow/syntax/text.html.mt.syntax +162 -0
- data/lib/textpow/syntax/text.html.ruby.syntax +40 -0
- data/lib/textpow/syntax/text.html.strict.active4d.syntax +311 -0
- data/lib/textpow/syntax/text.html.tcl.syntax +26 -0
- data/lib/textpow/syntax/text.html.textile.syntax +215 -0
- data/lib/textpow/syntax/text.html.tt.syntax +121 -0
- data/lib/textpow/syntax/text.html.twiki.syntax +241 -0
- data/lib/textpow/syntax/text.html.xhtml.1-strict.syntax +4027 -0
- data/lib/textpow/syntax/text.log.latex.syntax +50 -0
- data/lib/textpow/syntax/text.mail.markdown.syntax +118 -0
- data/lib/textpow/syntax/text.man.syntax +17 -0
- data/lib/textpow/syntax/text.moinmoin.syntax +189 -0
- data/lib/textpow/syntax/text.plain.gtd.syntax +22 -0
- data/lib/textpow/syntax/text.plain.release-notes.syntax +46 -0
- data/lib/textpow/syntax/text.plain.syntax +32 -0
- data/lib/textpow/syntax/text.plist.syntax +635 -0
- data/lib/textpow/syntax/text.pmwiki.syntax +113 -0
- data/lib/textpow/syntax/text.restructuredtext.syntax +250 -0
- data/lib/textpow/syntax/text.setext.syntax +147 -0
- data/lib/textpow/syntax/text.subversion-commit.syntax +36 -0
- data/lib/textpow/syntax/text.tabular.csv.syntax +68 -0
- data/lib/textpow/syntax/text.tabular.tsv.syntax +50 -0
- data/lib/textpow/syntax/text.tex.latex.beamer.syntax +41 -0
- data/lib/textpow/syntax/text.tex.latex.haskell.syntax +24 -0
- data/lib/textpow/syntax/text.tex.latex.memoir.syntax +64 -0
- data/lib/textpow/syntax/text.tex.latex.rd.syntax +91 -0
- data/lib/textpow/syntax/text.tex.latex.sweave.syntax +84 -0
- data/lib/textpow/syntax/text.tex.latex.syntax +566 -0
- data/lib/textpow/syntax/text.tex.math.syntax +49 -0
- data/lib/textpow/syntax/text.tex.syntax +86 -0
- data/lib/textpow/syntax/text.txt2tags.syntax +79 -0
- data/lib/textpow/syntax/text.xml.apple-dist.syntax +77 -0
- data/lib/textpow/syntax/text.xml.strict.syntax +92 -0
- data/lib/textpow/syntax/text.xml.syntax +180 -0
- data/lib/textpow/syntax/text.xml.xsl.syntax +60 -0
- data/lib/textpow/version.rb +3 -0
- data/spec/fixtures/objeck.plist +107 -0
- data/spec/fixtures/utf8.txt +1 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/textpow/score_manager_spec.rb +20 -0
- data/spec/textpow/syntax_files_spec.rb +26 -0
- data/spec/textpow/syntax_spec.rb +225 -0
- data/spec/textpow_spec.rb +57 -0
- data/textpow.gemspec +19 -0
- metadata +246 -68
- data/Manifest.txt +0 -13
- data/mm/manual.mm +0 -266
- data/test/test_textpow.rb +0 -25
@@ -0,0 +1,519 @@
|
|
1
|
+
---
|
2
|
+
scopeName: text.html.markdown
|
3
|
+
name: Markdown
|
4
|
+
keyEquivalent: ^~M
|
5
|
+
repository:
|
6
|
+
link-email:
|
7
|
+
name: meta.link.email.lt-gt.markdown
|
8
|
+
captures:
|
9
|
+
"1":
|
10
|
+
name: punctuation.definition.link.markdown
|
11
|
+
"2":
|
12
|
+
name: markup.underline.link.markdown
|
13
|
+
"4":
|
14
|
+
name: punctuation.definition.link.markdown
|
15
|
+
match: (<)((?:mailto:)?[-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(>)
|
16
|
+
bracket:
|
17
|
+
name: meta.other.valid-bracket.markdown
|
18
|
+
comment: "\n\
|
19
|
+
\t\t\t\tMarkdown will convert this for us. We match it so that the\n\
|
20
|
+
\t\t\t\tHTML grammar will not mark it up as invalid.\n\
|
21
|
+
\t\t\t"
|
22
|
+
match: <(?![a-z/?\$!])
|
23
|
+
list-paragraph:
|
24
|
+
patterns:
|
25
|
+
- name: meta.paragraph.list.markdown
|
26
|
+
begin: \G\s+(?=\S)
|
27
|
+
end: ^\s*$
|
28
|
+
patterns:
|
29
|
+
- include: "#inline"
|
30
|
+
- comment: Match the list punctuation
|
31
|
+
captures:
|
32
|
+
"1":
|
33
|
+
name: punctuation.definition.list_item.markdown
|
34
|
+
match: ^\s*([*+-]|[0-9]+\.)
|
35
|
+
link-ref-literal:
|
36
|
+
name: meta.link.reference.literal.markdown
|
37
|
+
captures:
|
38
|
+
"6":
|
39
|
+
name: punctuation.definition.constant.end.markdown
|
40
|
+
"1":
|
41
|
+
name: punctuation.definition.string.begin.markdown
|
42
|
+
"2":
|
43
|
+
name: string.other.link.title.markdown
|
44
|
+
"4":
|
45
|
+
name: punctuation.definition.string.end.markdown
|
46
|
+
"5":
|
47
|
+
name: punctuation.definition.constant.begin.markdown
|
48
|
+
match: (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(\])
|
49
|
+
image-inline:
|
50
|
+
name: meta.image.inline.markdown
|
51
|
+
captures:
|
52
|
+
"6":
|
53
|
+
name: punctuation.definition.metadata.markdown
|
54
|
+
"11":
|
55
|
+
name: punctuation.definition.string.markdown
|
56
|
+
"7":
|
57
|
+
name: punctuation.definition.link.markdown
|
58
|
+
"12":
|
59
|
+
name: punctuation.definition.string.markdown
|
60
|
+
"8":
|
61
|
+
name: markup.underline.link.image.markdown
|
62
|
+
"13":
|
63
|
+
name: string.other.link.description.title.markdown
|
64
|
+
"9":
|
65
|
+
name: punctuation.definition.link.markdown
|
66
|
+
"14":
|
67
|
+
name: punctuation.definition.string.markdown
|
68
|
+
"15":
|
69
|
+
name: punctuation.definition.string.markdown
|
70
|
+
"16":
|
71
|
+
name: punctuation.definition.metadata.markdown
|
72
|
+
"1":
|
73
|
+
name: punctuation.definition.string.begin.markdown
|
74
|
+
"2":
|
75
|
+
name: string.other.link.description.markdown
|
76
|
+
"3":
|
77
|
+
name: punctuation.definition.string.end.markdown
|
78
|
+
"10":
|
79
|
+
name: string.other.link.description.title.markdown
|
80
|
+
"5":
|
81
|
+
name: invalid.illegal.whitespace.markdown
|
82
|
+
match: "(?x:\n\
|
83
|
+
\t\t\t\t\\!\t\t\t\t\t\t\t# Images start with !\n\
|
84
|
+
\t\t\t\t(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])\t\n\
|
85
|
+
\t\t\t\t\t\t\t\t\t\t\t# Match the link text.\n\
|
86
|
+
\t\t\t\t([ ])?\t\t\t\t\t\t# Space not allowed\n\
|
87
|
+
\t\t\t\t(\\()\t\t\t\t\t\t# Opening paren for url\n\
|
88
|
+
\t\t\t\t\t(<?)(\\S+?)(>?)\t\t\t# The url\n\
|
89
|
+
\t\t\t\t\t[ \\t]*\t\t\t\t\t# Optional whitespace\n\
|
90
|
+
\t\t\t\t\t(?:\n\
|
91
|
+
\t\t\t\t\t\t ((\\().+?(\\)))\t\t# Match title in parens\xE2\x80\xA6\n\
|
92
|
+
\t\t\t\t\t\t| ((\").+?(\"))\t\t# or in quotes.\n\
|
93
|
+
\t\t\t\t\t)?\t\t\t\t\t\t# Title is optional\n\
|
94
|
+
\t\t\t\t\t\\s*\t\t\t\t\t\t# Optional whitespace\n\
|
95
|
+
\t\t\t\t(\\))\n\
|
96
|
+
\t\t\t )"
|
97
|
+
link-inline:
|
98
|
+
name: meta.link.inline.markdown
|
99
|
+
captures:
|
100
|
+
"6":
|
101
|
+
name: punctuation.definition.metadata.markdown
|
102
|
+
"11":
|
103
|
+
name: punctuation.definition.string.begin.markdown
|
104
|
+
"7":
|
105
|
+
name: punctuation.definition.link.markdown
|
106
|
+
"12":
|
107
|
+
name: punctuation.definition.string.end.markdown
|
108
|
+
"8":
|
109
|
+
name: markup.underline.link.markdown
|
110
|
+
"13":
|
111
|
+
name: string.other.link.description.title.markdown
|
112
|
+
"9":
|
113
|
+
name: punctuation.definition.link.markdown
|
114
|
+
"14":
|
115
|
+
name: punctuation.definition.string.begin.markdown
|
116
|
+
"15":
|
117
|
+
name: punctuation.definition.string.end.markdown
|
118
|
+
"16":
|
119
|
+
name: punctuation.definition.metadata.markdown
|
120
|
+
"1":
|
121
|
+
name: punctuation.definition.string.begin.markdown
|
122
|
+
"2":
|
123
|
+
name: string.other.link.title.markdown
|
124
|
+
"4":
|
125
|
+
name: punctuation.definition.string.end.markdown
|
126
|
+
"10":
|
127
|
+
name: string.other.link.description.title.markdown
|
128
|
+
"5":
|
129
|
+
name: invalid.illegal.whitespace.markdown
|
130
|
+
match: "(?x:\n\
|
131
|
+
\t\t\t\t(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])\t\n\
|
132
|
+
\t\t\t\t\t\t\t\t\t\t\t# Match the link text.\n\
|
133
|
+
\t\t\t\t([ ])?\t\t\t\t\t\t# Space not allowed\n\
|
134
|
+
\t\t\t\t(\\()\t\t\t\t\t\t# Opening paren for url\n\
|
135
|
+
\t\t\t\t\t(<?)(.*?)(>?)\t\t\t# The url\n\
|
136
|
+
\t\t\t\t\t[ \\t]*\t\t\t\t\t# Optional whitespace\n\
|
137
|
+
\t\t\t\t\t(?:\n\
|
138
|
+
\t\t\t\t\t\t ((\\().+?(\\)))\t\t# Match title in parens\xE2\x80\xA6\n\
|
139
|
+
\t\t\t\t\t\t| ((\").+?(\"))\t\t# or in quotes.\n\
|
140
|
+
\t\t\t\t\t)?\t\t\t\t\t\t# Title is optional\n\
|
141
|
+
\t\t\t\t\t\\s*\t\t\t\t\t\t# Optional whitespace\n\
|
142
|
+
\t\t\t\t(\\))\n\
|
143
|
+
\t\t\t )"
|
144
|
+
inline:
|
145
|
+
patterns:
|
146
|
+
- include: "#escape"
|
147
|
+
- include: "#ampersand"
|
148
|
+
- include: "#bracket"
|
149
|
+
- include: "#raw"
|
150
|
+
- include: "#bold"
|
151
|
+
- include: "#italic"
|
152
|
+
- include: "#line-break"
|
153
|
+
- include: "#image-inline"
|
154
|
+
- include: "#link-inline"
|
155
|
+
- include: "#link-inet"
|
156
|
+
- include: "#link-email"
|
157
|
+
- include: "#image-ref"
|
158
|
+
- include: "#link-ref-literal"
|
159
|
+
- include: "#link-ref"
|
160
|
+
image-ref:
|
161
|
+
name: meta.image.reference.markdown
|
162
|
+
captures:
|
163
|
+
"6":
|
164
|
+
name: constant.other.reference.link.markdown
|
165
|
+
"7":
|
166
|
+
name: punctuation.definition.constant.markdown
|
167
|
+
"1":
|
168
|
+
name: punctuation.definition.string.begin.markdown
|
169
|
+
"2":
|
170
|
+
name: string.other.link.description.markdown
|
171
|
+
"4":
|
172
|
+
name: punctuation.definition.string.begin.markdown
|
173
|
+
"5":
|
174
|
+
name: punctuation.definition.constant.markdown
|
175
|
+
match: \!(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(.*?)(\])
|
176
|
+
escape:
|
177
|
+
name: constant.character.escape.markdown
|
178
|
+
match: \\[-`*_#+.!(){}\[\]\\>]
|
179
|
+
block_quote:
|
180
|
+
name: markup.quote.markdown
|
181
|
+
comment: "\n\
|
182
|
+
\t\t\t\tWe terminate the block quote when seeing an empty line, a\n\
|
183
|
+
\t\t\t\tseparator or a line with leading > characters. The latter is\n\
|
184
|
+
\t\t\t\tto \xE2\x80\x9Creset\xE2\x80\x9D the quote level for quoted lines.\n\
|
185
|
+
\t\t\t"
|
186
|
+
begin: \G[ ]{,3}(>)(?!$)[ ]?
|
187
|
+
beginCaptures:
|
188
|
+
"1":
|
189
|
+
name: punctuation.definition.blockquote.markdown
|
190
|
+
end: |-
|
191
|
+
(?x)^
|
192
|
+
(?= \s*$
|
193
|
+
| [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
|
194
|
+
| [ ]{,3}>.
|
195
|
+
)
|
196
|
+
patterns:
|
197
|
+
- begin: !binary |
|
198
|
+
KD94KVxHCgkJCQkJCSg/PQlbIF17LDN9Pi4KCQkJCQkJKQ==
|
199
|
+
|
200
|
+
end: ^
|
201
|
+
patterns:
|
202
|
+
- include: "#block_quote"
|
203
|
+
- begin: |-
|
204
|
+
(?x)\G
|
205
|
+
(?= ([ ]{4}|\t)
|
206
|
+
| [#]{1,6}\s*+
|
207
|
+
| [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
|
208
|
+
)
|
209
|
+
applyEndPatternLast: 1
|
210
|
+
end: ^
|
211
|
+
patterns:
|
212
|
+
- include: "#block_raw"
|
213
|
+
- include: "#heading"
|
214
|
+
- include: "#separator"
|
215
|
+
- begin: |-
|
216
|
+
(?x)\G
|
217
|
+
(?! $
|
218
|
+
| [ ]{,3}>.
|
219
|
+
| ([ ]{4}|\t)
|
220
|
+
| [#]{1,6}\s*+
|
221
|
+
| [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
|
222
|
+
)
|
223
|
+
end: $|(?<=\n)
|
224
|
+
patterns:
|
225
|
+
- include: "#inline"
|
226
|
+
link-ref:
|
227
|
+
name: meta.link.reference.markdown
|
228
|
+
captures:
|
229
|
+
"6":
|
230
|
+
name: constant.other.reference.link.markdown
|
231
|
+
"7":
|
232
|
+
name: punctuation.definition.constant.end.markdown
|
233
|
+
"1":
|
234
|
+
name: punctuation.definition.string.begin.markdown
|
235
|
+
"2":
|
236
|
+
name: string.other.link.title.markdown
|
237
|
+
"4":
|
238
|
+
name: punctuation.definition.string.end.markdown
|
239
|
+
"5":
|
240
|
+
name: punctuation.definition.constant.begin.markdown
|
241
|
+
match: (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)([^\]]*+)(\])
|
242
|
+
block_raw:
|
243
|
+
name: markup.raw.block.markdown
|
244
|
+
match: \G([ ]{4}|\t).*$\n?
|
245
|
+
bold:
|
246
|
+
name: markup.bold.markdown
|
247
|
+
begin: !binary |
|
248
|
+
KD94KQoJCQkJCQkoXCpcKnxfXykoPz1cUykJCQkJCQkJCSMgT3BlbgoJCQkJ
|
249
|
+
CQkoPz0KCQkJCQkJCSgKCQkJCQkJCSAgICA8W14+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QkJ
|
265
|
+
CQkJCQkJCVsgXHRdKisJCQkJIyBPcHRpb25hbCB3aHRpZXNwYWNlCgkJCQkJ
|
266
|
+
CQkJCQkJCSgJCQkJCSMgT3B0aW9uYWwgVGl0bGUKCQkJCQkJCQkJCQkJCSg/
|
267
|
+
PHRpdGxlPlsnIl0pCgkJCQkJCQkJCQkJCQkoLio/KQoJCQkJCQkJCQkJCQkJ
|
268
|
+
XGs8dGl0bGU+CgkJCQkJCQkJCQkJCSk/CgkJCQkJCQkJCQkJXCkKCQkJCQkJ
|
269
|
+
CQkJCSkKCQkJCQkJCQkJKQoJCQkJCQkJCSkKCQkJCQkJCSAgfCAoPyEoPzw9
|
270
|
+
XFMpXDEpLgkJCQkJCSMgRXZlcnl0aGluZyBiZXNpZGVzCgkJCQkJCQkJCQkJ
|
271
|
+
CQkJCQkJIyBzdHlsZSBjbG9zZXIKCQkJCQkJCSkrKwoJCQkJCQkJKD88PVxT
|
272
|
+
KVwxCQkJCQkJCQkjIENsb3NlCgkJCQkJCSkKCQkJCQk=
|
273
|
+
|
274
|
+
captures:
|
275
|
+
"1":
|
276
|
+
name: punctuation.definition.bold.markdown
|
277
|
+
end: (?<=\S)(\1)
|
278
|
+
patterns:
|
279
|
+
- begin: (?=<[^>]*?>)
|
280
|
+
applyEndPatternLast: 1
|
281
|
+
end: (?<=>)
|
282
|
+
patterns:
|
283
|
+
- include: text.html.basic
|
284
|
+
- include: "#escape"
|
285
|
+
- include: "#ampersand"
|
286
|
+
- include: "#bracket"
|
287
|
+
- include: "#raw"
|
288
|
+
- include: "#italic"
|
289
|
+
- include: "#image-inline"
|
290
|
+
- include: "#link-inline"
|
291
|
+
- include: "#link-inet"
|
292
|
+
- include: "#link-email"
|
293
|
+
- include: "#image-ref"
|
294
|
+
- include: "#link-ref-literal"
|
295
|
+
- include: "#link-ref"
|
296
|
+
heading:
|
297
|
+
name: markup.heading.markdown
|
298
|
+
begin: \G(#{1,6})(?!#)\s*(?=\S)
|
299
|
+
captures:
|
300
|
+
"1":
|
301
|
+
name: punctuation.definition.heading.markdown
|
302
|
+
end: \s*(#*)$\n?
|
303
|
+
contentName: entity.name.section.markdown
|
304
|
+
patterns:
|
305
|
+
- include: "#inline"
|
306
|
+
separator:
|
307
|
+
name: meta.separator.markdown
|
308
|
+
match: \G[ ]{,3}([-*_])([ ]{,2}\1){2,}[ \t]*$\n?
|
309
|
+
italic:
|
310
|
+
name: markup.italic.markdown
|
311
|
+
begin: !binary |
|
312
|
+
KD94KQoJCQkJCQkoXCp8XykoPz1cUykJCQkJCQkJCSMgT3BlbgoJCQkJCQko
|
313
|
+
Pz0KCQkJCQkJCSgKCQkJCQkJCSAgICA8W14+XSorPgkJCQkJCQkjIEhUTUwg
|
314
|
+
dGFncwoJCQkJCQkJICB8ICg/PHJhdz5gKykoW15gXXwoPyEoPzwhYClcazxy
|
315
|
+
YXc+KD8hYCkpYCkqK1xrPHJhdz4KCQkJCQkJCQkJCQkJCQkJCQkjIFJhdwoJ
|
316
|
+
CQkJCQkJICB8IFxcW1xcYCpfe31cW1xdKCkjLiErXC0+XT8rCQkJIyBFc2Nh
|
317
|
+
cGVzCgkJCQkJCQkgIHwgXFsKCQkJCQkJCQkoCQkJCQoJCQkJCQkJCSAgICAg
|
318
|
+
ICAgKD88c3F1YXJlPgkJCQkJIyBOYW1lZCBncm91cAoJCQkJCQkJCQkJCVte
|
319
|
+
XFtcXVxcXQkJCQkjIE1hdGNoIG1vc3QgY2hhcnMKCQkJCQkJCQkgICAgICAg
|
320
|
+
ICAgfCBcXC4JCQkJCQkjIEVzY2FwZWQgY2hhcnMKCQkJCQkJCQkgICAgICAg
|
321
|
+
ICAgfCBcWyBcZzxzcXVhcmU+KisgXF0JCSMgTmVzdGVkIGJyYWNrZXRzCgkJ
|
322
|
+
CQkJCQkJICAgICAgICApKisKCQkJCQkJCQkJXF0KCQkJCQkJCQkJKAoJCQkJ
|
323
|
+
CQkJCQkJKAkJCQkJCQkjIFJlZmVyZW5jZSBMaW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
+
end: (?<=\S)(\1)((?!\1)|(?=\1\1))
|
343
|
+
patterns:
|
344
|
+
- begin: (?=<[^>]*?>)
|
345
|
+
applyEndPatternLast: 1
|
346
|
+
end: (?<=>)
|
347
|
+
patterns:
|
348
|
+
- include: text.html.basic
|
349
|
+
- include: "#escape"
|
350
|
+
- include: "#ampersand"
|
351
|
+
- include: "#bracket"
|
352
|
+
- include: "#raw"
|
353
|
+
- include: "#bold"
|
354
|
+
- include: "#image-inline"
|
355
|
+
- include: "#link-inline"
|
356
|
+
- include: "#link-inet"
|
357
|
+
- include: "#link-email"
|
358
|
+
- include: "#image-ref"
|
359
|
+
- include: "#link-ref-literal"
|
360
|
+
- include: "#link-ref"
|
361
|
+
raw:
|
362
|
+
name: markup.raw.inline.markdown
|
363
|
+
captures:
|
364
|
+
"1":
|
365
|
+
name: punctuation.definition.raw.markdown
|
366
|
+
"3":
|
367
|
+
name: punctuation.definition.raw.markdown
|
368
|
+
match: (`+)([^`]|(?!(?<!`)\1(?!`))`)*+(\1)
|
369
|
+
link-inet:
|
370
|
+
name: meta.link.inet.markdown
|
371
|
+
captures:
|
372
|
+
"1":
|
373
|
+
name: punctuation.definition.link.markdown
|
374
|
+
"2":
|
375
|
+
name: markup.underline.link.markdown
|
376
|
+
"3":
|
377
|
+
name: punctuation.definition.link.markdown
|
378
|
+
match: (<)((?:https?|ftp)://.*?)(>)
|
379
|
+
line-break:
|
380
|
+
name: meta.dummy.line-break
|
381
|
+
match: " {2,}$"
|
382
|
+
ampersand:
|
383
|
+
name: meta.other.valid-ampersand.markdown
|
384
|
+
comment: "\n\
|
385
|
+
\t\t\t\tMarkdown will convert this for us. We match it so that the\n\
|
386
|
+
\t\t\t\tHTML grammar will not mark it up as invalid.\n\
|
387
|
+
\t\t\t"
|
388
|
+
match: "&(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)"
|
389
|
+
uuid: 0A1D9874-B448-11D9-BD50-000D93B6E43C
|
390
|
+
patterns:
|
391
|
+
- name: meta.block-level.markdown
|
392
|
+
comment: "\n\
|
393
|
+
\t\t\t\tWe could also use an empty end match and set\n\
|
394
|
+
\t\t\t\tapplyEndPatternLast, but then we must be sure that the begin\n\
|
395
|
+
\t\t\t\tpattern will only match stuff matched by the sub-patterns.\n\
|
396
|
+
\t\t\t"
|
397
|
+
begin: |-
|
398
|
+
(?x)^
|
399
|
+
(?= [ ]{,3}>.
|
400
|
+
| ([ ]{4}|\t)(?!$)
|
401
|
+
| [#]{1,6}\s*+
|
402
|
+
| [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
|
403
|
+
)
|
404
|
+
end: |-
|
405
|
+
(?x)^
|
406
|
+
(?! [ ]{,3}>.
|
407
|
+
| ([ ]{4}|\t)
|
408
|
+
| [#]{1,6}\s*+
|
409
|
+
| [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
|
410
|
+
)
|
411
|
+
patterns:
|
412
|
+
- include: "#block_quote"
|
413
|
+
- include: "#block_raw"
|
414
|
+
- include: "#heading"
|
415
|
+
- include: "#separator"
|
416
|
+
- name: markup.list.unnumbered.markdown
|
417
|
+
begin: ^[ ]{0,3}([*+-])(?=\s)
|
418
|
+
captures:
|
419
|
+
"1":
|
420
|
+
name: punctuation.definition.list_item.markdown
|
421
|
+
end: ^(?=\S)
|
422
|
+
patterns:
|
423
|
+
- include: "#list-paragraph"
|
424
|
+
- name: markup.list.numbered.markdown
|
425
|
+
begin: ^[ ]{0,3}([0-9]+\.)(?=\s)
|
426
|
+
captures:
|
427
|
+
"1":
|
428
|
+
name: punctuation.definition.list_item.markdown
|
429
|
+
end: ^(?=\S)
|
430
|
+
patterns:
|
431
|
+
- include: "#list-paragraph"
|
432
|
+
- name: meta.disable-markdown
|
433
|
+
comment: "\n\
|
434
|
+
\t\t\t\tMarkdown formatting is disabled inside block-level tags.\n\
|
435
|
+
\t\t\t"
|
436
|
+
begin: ^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)(?!.*?</\1>)
|
437
|
+
end: (?<=^</\1>$\n)
|
438
|
+
patterns:
|
439
|
+
- include: text.html.basic
|
440
|
+
- name: meta.disable-markdown
|
441
|
+
comment: Same rule but for one line disables.
|
442
|
+
begin: ^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)
|
443
|
+
end: $\n?
|
444
|
+
patterns:
|
445
|
+
- include: text.html.basic
|
446
|
+
- name: meta.link.reference.def.markdown
|
447
|
+
captures:
|
448
|
+
"6":
|
449
|
+
name: markup.underline.link.markdown
|
450
|
+
"11":
|
451
|
+
name: string.other.link.description.title.markdown
|
452
|
+
"7":
|
453
|
+
name: punctuation.definition.link.markdown
|
454
|
+
"12":
|
455
|
+
name: punctuation.definition.string.begin.markdown
|
456
|
+
"8":
|
457
|
+
name: string.other.link.description.title.markdown
|
458
|
+
"13":
|
459
|
+
name: punctuation.definition.string.end.markdown
|
460
|
+
"9":
|
461
|
+
name: punctuation.definition.string.begin.markdown
|
462
|
+
"1":
|
463
|
+
name: punctuation.definition.constant.markdown
|
464
|
+
"2":
|
465
|
+
name: constant.other.reference.link.markdown
|
466
|
+
"3":
|
467
|
+
name: punctuation.definition.constant.markdown
|
468
|
+
"4":
|
469
|
+
name: punctuation.separator.key-value.markdown
|
470
|
+
"10":
|
471
|
+
name: punctuation.definition.string.end.markdown
|
472
|
+
"5":
|
473
|
+
name: punctuation.definition.link.markdown
|
474
|
+
match: "(?x:\n\
|
475
|
+
\t\t\t\t\\s*\t\t\t\t\t\t# Leading whitespace\n\
|
476
|
+
\t\t\t\t(\\[)(.+?)(\\])(:)\t\t# Reference name\n\
|
477
|
+
\t\t\t\t[ \\t]*\t\t\t\t\t# Optional whitespace\n\
|
478
|
+
\t\t\t\t(<?)(\\S+?)(>?)\t\t\t# The url\n\
|
479
|
+
\t\t\t\t[ \\t]*\t\t\t\t\t# Optional whitespace\n\
|
480
|
+
\t\t\t\t(?:\n\
|
481
|
+
\t\t\t\t\t ((\\().+?(\\)))\t\t# Match title in quotes\xE2\x80\xA6\n\
|
482
|
+
\t\t\t\t\t| ((\").+?(\"))\t\t# or in parens.\n\
|
483
|
+
\t\t\t\t)?\t\t\t\t\t\t# Title is optional\n\
|
484
|
+
\t\t\t\t\\s*\t\t\t\t\t\t# Optional whitespace\n\
|
485
|
+
\t\t\t\t$\n\
|
486
|
+
\t\t\t)"
|
487
|
+
- name: meta.paragraph.markdown
|
488
|
+
begin: ^(?=\S)(?![=-]{3,}(?=$))
|
489
|
+
end: ^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ \t]*\n|(?=^#)
|
490
|
+
patterns:
|
491
|
+
- include: "#inline"
|
492
|
+
- include: text.html.basic
|
493
|
+
- name: markup.heading.1.markdown
|
494
|
+
captures:
|
495
|
+
"1":
|
496
|
+
name: punctuation.definition.heading.markdown
|
497
|
+
match: ^(={3,})(?=[ \t]*$)
|
498
|
+
- name: markup.heading.2.markdown
|
499
|
+
captures:
|
500
|
+
"1":
|
501
|
+
name: punctuation.definition.heading.markdown
|
502
|
+
match: ^(-{3,})(?=[ \t]*$)
|
503
|
+
foldingStartMarker: |-
|
504
|
+
(?x)
|
505
|
+
(<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\b.*?>
|
506
|
+
|<!--(?!.*-->)
|
507
|
+
|\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/)))
|
508
|
+
)
|
509
|
+
foldingStopMarker: |-
|
510
|
+
(?x)
|
511
|
+
(</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)>
|
512
|
+
|^\s*-->
|
513
|
+
|(^|\s)\}
|
514
|
+
)
|
515
|
+
fileTypes:
|
516
|
+
- mdown
|
517
|
+
- markdown
|
518
|
+
- markdn
|
519
|
+
- md
|