textpow1x 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,13 @@
1
+ module Textpow
2
+ class RecordingProcessor
3
+ attr_accessor :stack
4
+
5
+ def initialize
6
+ @stack = []
7
+ end
8
+
9
+ def method_missing(name, *args)
10
+ @stack << [name, *args]
11
+ end
12
+ end
13
+ end
@@ -1,12 +1,51 @@
1
1
  ---
2
- name: Markdown
3
- fileTypes:
4
- - markdown
5
- - mdown
6
- - markdn
7
- - md
8
2
  scopeName: text.html.markdown
3
+ name: Markdown
4
+ keyEquivalent: ^~M
9
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>*+\])*+)(\])[ ]?(\[)(\])
10
49
  image-inline:
11
50
  name: meta.image.inline.markdown
12
51
  captures:
@@ -55,63 +94,53 @@ repository:
55
94
  \t\t\t\t\t\\s*\t\t\t\t\t\t# Optional whitespace\n\
56
95
  \t\t\t\t(\\))\n\
57
96
  \t\t\t )"
58
- image-ref:
59
- name: meta.image.reference.markdown
97
+ link-inline:
98
+ name: meta.link.inline.markdown
60
99
  captures:
61
100
  "6":
62
- name: constant.other.reference.link.markdown
63
- "7":
64
- name: punctuation.definition.constant.markdown
65
- "1":
101
+ name: punctuation.definition.metadata.markdown
102
+ "11":
66
103
  name: punctuation.definition.string.begin.markdown
67
- "2":
68
- name: string.other.link.description.markdown
69
- "4":
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":
70
115
  name: punctuation.definition.string.begin.markdown
71
- "5":
72
- name: punctuation.definition.constant.markdown
73
- match: \!(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(.*?)(\])
74
- escape:
75
- name: constant.character.escape.markdown
76
- match: \\[-`*_#+.!(){}\[\]\\>]
77
- bracket:
78
- name: meta.other.valid-bracket.markdown
79
- match: <(?![a-z/?\$!])
80
- comment: "\n\
81
- \t\t\t\tMarkdown will convert this for us. We match it so that the\n\
82
- \t\t\t\tHTML grammar will not mark it up as invalid.\n\
83
- \t\t\t"
84
- list-paragraph:
85
- patterns:
86
- - name: meta.paragraph.list.markdown
87
- begin: \G\s+(?=\S)
88
- end: ^\s*$
89
- patterns:
90
- - include: "#inline"
91
- link-ref-literal:
92
- name: meta.link.reference.literal.markdown
93
- captures:
94
- "6":
95
- name: punctuation.definition.constant.end.markdown
116
+ "15":
117
+ name: punctuation.definition.string.end.markdown
118
+ "16":
119
+ name: punctuation.definition.metadata.markdown
96
120
  "1":
97
121
  name: punctuation.definition.string.begin.markdown
98
122
  "2":
99
123
  name: string.other.link.title.markdown
100
124
  "4":
101
125
  name: punctuation.definition.string.end.markdown
126
+ "10":
127
+ name: string.other.link.description.title.markdown
102
128
  "5":
103
- name: punctuation.definition.constant.begin.markdown
104
- match: (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(\])
105
- link-email:
106
- name: meta.link.email.lt-gt.markdown
107
- captures:
108
- "1":
109
- name: punctuation.definition.link.markdown
110
- "2":
111
- name: markup.underline.link.markdown
112
- "4":
113
- name: punctuation.definition.link.markdown
114
- match: (<)((?:mailto:)?[-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(>)
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 )"
115
144
  inline:
116
145
  patterns:
117
146
  - include: "#escape"
@@ -128,8 +157,32 @@ repository:
128
157
  - include: "#image-ref"
129
158
  - include: "#link-ref-literal"
130
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: \\[-`*_#+.!(){}\[\]\\>]
131
179
  block_quote:
132
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"
133
186
  begin: \G[ ]{,3}(>)(?!$)[ ]?
134
187
  beginCaptures:
135
188
  "1":
@@ -137,14 +190,13 @@ repository:
137
190
  end: |-
138
191
  (?x)^
139
192
  (?= \s*$
140
- | [ ]{,3}(?<marker>[-*_])([ ]{,2}\g<marker>){2,}[ \t]*+$
193
+ | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
141
194
  | [ ]{,3}>.
142
195
  )
143
196
  patterns:
144
- - begin: |-
145
- (?x)\G
146
- (?= [ ]{,3}>.
147
- )
197
+ - begin: !binary |
198
+ KD94KVxHCgkJCQkJCSg/PQlbIF17LDN9Pi4KCQkJCQkJKQ==
199
+
148
200
  end: ^
149
201
  patterns:
150
202
  - include: "#block_quote"
@@ -152,7 +204,7 @@ repository:
152
204
  (?x)\G
153
205
  (?= ([ ]{4}|\t)
154
206
  | [#]{1,6}\s*+
155
- | [ ]{,3}(?<marker>[-*_])([ ]{,2}\g<marker>){2,}[ \t]*+$
207
+ | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
156
208
  )
157
209
  applyEndPatternLast: 1
158
210
  end: ^
@@ -166,16 +218,11 @@ repository:
166
218
  | [ ]{,3}>.
167
219
  | ([ ]{4}|\t)
168
220
  | [#]{1,6}\s*+
169
- | [ ]{,3}(?<marker>[-*_])([ ]{,2}\g<marker>){2,}[ \t]*+$
221
+ | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
170
222
  )
171
223
  end: $|(?<=\n)
172
224
  patterns:
173
225
  - include: "#inline"
174
- comment: "\n\
175
- \t\t\t\tWe terminate the block quote when seeing an empty line, a\n\
176
- \t\t\t\tseparator or a line with leading > characters. The latter is\n\
177
- \t\t\t\tto \xE2\x80\x9Creset\xE2\x80\x9D the quote level for quoted lines.\n\
178
- \t\t\t"
179
226
  link-ref:
180
227
  name: meta.link.reference.markdown
181
228
  captures:
@@ -195,102 +242,38 @@ repository:
195
242
  block_raw:
196
243
  name: markup.raw.block.markdown
197
244
  match: \G([ ]{4}|\t).*$\n?
198
- separator:
199
- name: meta.separator.markdown
200
- match: \G[ ]{,3}([-*_])([ ]{,2}\1){2,}[ \t]*$\n?
201
- link-inline:
202
- name: meta.link.inline.markdown
203
- captures:
204
- "6":
205
- name: punctuation.definition.metadata.markdown
206
- "11":
207
- name: punctuation.definition.string.begin.markdown
208
- "7":
209
- name: punctuation.definition.link.markdown
210
- "12":
211
- name: punctuation.definition.string.end.markdown
212
- "8":
213
- name: markup.underline.link.markdown
214
- "13":
215
- name: string.other.link.description.title.markdown
216
- "9":
217
- name: punctuation.definition.link.markdown
218
- "14":
219
- name: punctuation.definition.string.begin.markdown
220
- "15":
221
- name: punctuation.definition.string.end.markdown
222
- "16":
223
- name: punctuation.definition.metadata.markdown
224
- "1":
225
- name: punctuation.definition.string.begin.markdown
226
- "2":
227
- name: string.other.link.title.markdown
228
- "4":
229
- name: punctuation.definition.string.end.markdown
230
- "10":
231
- name: string.other.link.description.title.markdown
232
- "5":
233
- name: invalid.illegal.whitespace.markdown
234
- match: "(?x:\n\
235
- \t\t\t\t(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])\t\n\
236
- \t\t\t\t\t\t\t\t\t\t\t# Match the link text.\n\
237
- \t\t\t\t([ ])?\t\t\t\t\t\t# Space not allowed\n\
238
- \t\t\t\t(\\()\t\t\t\t\t\t# Opening paren for url\n\
239
- \t\t\t\t\t(<?)(.*?)(>?)\t\t\t# The url\n\
240
- \t\t\t\t\t[ \\t]*\t\t\t\t\t# Optional whitespace\n\
241
- \t\t\t\t\t(?:\n\
242
- \t\t\t\t\t\t ((\\().+?(\\)))\t\t# Match title in parens\xE2\x80\xA6\n\
243
- \t\t\t\t\t\t| ((\").+?(\"))\t\t# or in quotes.\n\
244
- \t\t\t\t\t)?\t\t\t\t\t\t# Title is optional\n\
245
- \t\t\t\t\t\\s*\t\t\t\t\t\t# Optional whitespace\n\
246
- \t\t\t\t(\\))\n\
247
- \t\t\t )"
248
245
  bold:
249
246
  name: markup.bold.markdown
247
+ begin: !binary |
248
+ KD94KQoJCQkJCQkoXCpcKnxfXykoPz1cUykJCQkJCQkJCSMgT3BlbgoJCQkJ
249
+ CQkoPz0KCQkJCQkJCSgKCQkJCQkJCSAgICA8W14+XSorPgkJCQkJCQkjIEhU
250
+ TUwgdGFncwoJCQkJCQkJICB8ICg/PHJhdz5gKykoW15gXXwoPyEoPzwhYClc
251
+ azxyYXc+KD8hYCkpYCkqK1xrPHJhdz4KCQkJCQkJCQkJCQkJCQkJCQkjIFJh
252
+ dwoJCQkJCQkJICB8IFxcW1xcYCpfe31cW1xdKCkjLiErXC0+XT8rCQkJIyBF
253
+ c2NhcGVzCgkJCQkJCQkgIHwgXFsKCQkJCQkJCQkoCQkJCQoJCQkJCQkJCSAg
254
+ ICAgICAgKD88c3F1YXJlPgkJCQkJIyBOY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yBiZXNpZGVzCgkJCQkJCQkJCQkJ
271
+ CQkJCQkJIyBzdHlsZSBjbG9zZXIKCQkJCQkJCSkrKwoJCQkJCQkJKD88PVxT
272
+ KVwxCQkJCQkJCQkjIENsb3NlCgkJCQkJCSkKCQkJCQk=
273
+
250
274
  captures:
251
275
  "1":
252
276
  name: punctuation.definition.bold.markdown
253
- begin: "(?x)\n\
254
- \t\t\t\t\t\t(\\*\\*|__)(?=\\S)\t\t\t\t\t\t\t\t# Open\n\
255
- \t\t\t\t\t\t(?=\n\
256
- \t\t\t\t\t\t\t(\n\
257
- \t\t\t\t\t\t\t <[^>]*+>\t\t\t\t\t\t\t# HTML tags\n\
258
- \t\t\t\t\t\t\t | (?<raw>`+)([^`]|(?!(?<!`)\\g<raw>(?!`))`)*+\\g<raw>\n\
259
- \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# Raw\n\
260
- \t\t\t\t\t\t\t | \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+\t\t\t# Escapes\n\
261
- \t\t\t\t\t\t\t | \\[\n\
262
- \t\t\t\t\t\t\t\t(\t\t\t\t\n\
263
- \t\t\t\t\t\t\t\t (?<square>\t\t\t\t\t# Named group\n\
264
- \t\t\t\t\t\t\t\t\t\t\t[^\\[\\]\\\\]\t\t\t\t# Match most chars\n\
265
- \t\t\t\t\t\t\t\t | \\\\.\t\t\t\t\t\t# Escaped chars\n\
266
- \t\t\t\t\t\t\t\t | \\[ \\g<square>*+ \\]\t\t# Nested brackets\n\
267
- \t\t\t\t\t\t\t\t )*+\n\
268
- \t\t\t\t\t\t\t\t\t\\]\n\
269
- \t\t\t\t\t\t\t\t\t(\n\
270
- \t\t\t\t\t\t\t\t\t\t(\t\t\t\t\t\t\t# Reference Link\n\
271
- \t\t\t\t\t\t\t\t\t\t\t[ ]?\t\t\t\t\t# Optional space\n\
272
- \t\t\t\t\t\t\t\t\t\t\t\\[[^\\]]*+\\]\t\t\t\t# Ref name\n\
273
- \t\t\t\t\t\t\t\t\t\t)\n\
274
- \t\t\t\t\t\t\t\t\t | (\t\t\t\t\t\t\t# Inline Link\n\
275
- \t\t\t\t\t\t\t\t\t\t\t\\(\t\t\t\t\t\t# Opening paren\n\
276
- \t\t\t\t\t\t\t\t\t\t\t\t[ \\t]*+\t\t\t\t# Optional whtiespace\n\
277
- \t\t\t\t\t\t\t\t\t\t\t\t<?(.*?)>?\t\t\t# URL\n\
278
- \t\t\t\t\t\t\t\t\t\t\t\t[ \\t]*+\t\t\t\t# Optional whtiespace\n\
279
- \t\t\t\t\t\t\t\t\t\t\t\t(\t\t\t\t\t# Optional Title\n\
280
- \t\t\t\t\t\t\t\t\t\t\t\t\t(?<title>['\"])\n\
281
- \t\t\t\t\t\t\t\t\t\t\t\t\t(.*?)\n\
282
- \t\t\t\t\t\t\t\t\t\t\t\t\t\\g<title>\n\
283
- \t\t\t\t\t\t\t\t\t\t\t\t)?\n\
284
- \t\t\t\t\t\t\t\t\t\t\t\\)\n\
285
- \t\t\t\t\t\t\t\t\t\t)\n\
286
- \t\t\t\t\t\t\t\t\t)\n\
287
- \t\t\t\t\t\t\t\t)\n\
288
- \t\t\t\t\t\t\t | (?!(?<=\\S)\\1).\t\t\t\t\t\t# Everything besides\n\
289
- \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# style closer\n\
290
- \t\t\t\t\t\t\t)++\n\
291
- \t\t\t\t\t\t\t(?<=\\S)\\1\t\t\t\t\t\t\t\t# Close\n\
292
- \t\t\t\t\t\t)\n\
293
- \t\t\t\t\t"
294
277
  end: (?<=\S)(\1)
295
278
  patterns:
296
279
  - begin: (?=<[^>]*?>)
@@ -312,79 +295,50 @@ repository:
312
295
  - include: "#link-ref"
313
296
  heading:
314
297
  name: markup.heading.markdown
298
+ begin: \G(#{1,6})(?!#)\s*(?=\S)
315
299
  captures:
316
300
  "1":
317
301
  name: punctuation.definition.heading.markdown
318
- begin: \G(#{1,6})(?!#)\s*(?=\S)
319
- contentName: entity.name.section.markdown
320
302
  end: \s*(#*)$\n?
303
+ contentName: entity.name.section.markdown
321
304
  patterns:
322
305
  - include: "#inline"
323
- link-inet:
324
- name: meta.link.inet.markdown
325
- captures:
326
- "1":
327
- name: punctuation.definition.link.markdown
328
- "2":
329
- name: markup.underline.link.markdown
330
- "3":
331
- name: punctuation.definition.link.markdown
332
- match: (<)((?:https?|ftp)://.*?)(>)
333
- raw:
334
- name: markup.raw.inline.markdown
335
- captures:
336
- "1":
337
- name: punctuation.definition.raw.markdown
338
- "3":
339
- name: punctuation.definition.raw.markdown
340
- match: (`+)([^`]|(?!(?<!`)\1(?!`))`)*+(\1)
306
+ separator:
307
+ name: meta.separator.markdown
308
+ match: \G[ ]{,3}([-*_])([ ]{,2}\1){2,}[ \t]*$\n?
341
309
  italic:
342
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+K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CgkJCQkJCSkKCQkJCQk=
338
+
343
339
  captures:
344
340
  "1":
345
341
  name: punctuation.definition.italic.markdown
346
- begin: "(?x)\n\
347
- \t\t\t\t\t\t(\\*|_)(?=\\S)\t\t\t\t\t\t\t\t# Open\n\
348
- \t\t\t\t\t\t(?=\n\
349
- \t\t\t\t\t\t\t(\n\
350
- \t\t\t\t\t\t\t <[^>]*+>\t\t\t\t\t\t\t# HTML tags\n\
351
- \t\t\t\t\t\t\t | (?<raw>`+)([^`]|(?!(?<!`)\\g<raw>(?!`))`)*+\\g<raw>\n\
352
- \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# Raw\n\
353
- \t\t\t\t\t\t\t | \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+\t\t\t# Escapes\n\
354
- \t\t\t\t\t\t\t | \\[\n\
355
- \t\t\t\t\t\t\t\t(\t\t\t\t\n\
356
- \t\t\t\t\t\t\t\t (?<square>\t\t\t\t\t# Named group\n\
357
- \t\t\t\t\t\t\t\t\t\t\t[^\\[\\]\\\\]\t\t\t\t# Match most chars\n\
358
- \t\t\t\t\t\t\t\t | \\\\.\t\t\t\t\t\t# Escaped chars\n\
359
- \t\t\t\t\t\t\t\t | \\[ \\g<square>*+ \\]\t\t# Nested brackets\n\
360
- \t\t\t\t\t\t\t\t )*+\n\
361
- \t\t\t\t\t\t\t\t\t\\]\n\
362
- \t\t\t\t\t\t\t\t\t(\n\
363
- \t\t\t\t\t\t\t\t\t\t(\t\t\t\t\t\t\t# Reference Link\n\
364
- \t\t\t\t\t\t\t\t\t\t\t[ ]?\t\t\t\t\t# Optional space\n\
365
- \t\t\t\t\t\t\t\t\t\t\t\\[[^\\]]*+\\]\t\t\t\t# Ref name\n\
366
- \t\t\t\t\t\t\t\t\t\t)\n\
367
- \t\t\t\t\t\t\t\t\t | (\t\t\t\t\t\t\t# Inline Link\n\
368
- \t\t\t\t\t\t\t\t\t\t\t\\(\t\t\t\t\t\t# Opening paren\n\
369
- \t\t\t\t\t\t\t\t\t\t\t\t[ \\t]*+\t\t\t\t# Optional whtiespace\n\
370
- \t\t\t\t\t\t\t\t\t\t\t\t<?(.*?)>?\t\t\t# URL\n\
371
- \t\t\t\t\t\t\t\t\t\t\t\t[ \\t]*+\t\t\t\t# Optional whtiespace\n\
372
- \t\t\t\t\t\t\t\t\t\t\t\t(\t\t\t\t\t# Optional Title\n\
373
- \t\t\t\t\t\t\t\t\t\t\t\t\t(?<title>['\"])\n\
374
- \t\t\t\t\t\t\t\t\t\t\t\t\t(.*?)\n\
375
- \t\t\t\t\t\t\t\t\t\t\t\t\t\\g<title>\n\
376
- \t\t\t\t\t\t\t\t\t\t\t\t)?\n\
377
- \t\t\t\t\t\t\t\t\t\t\t\\)\n\
378
- \t\t\t\t\t\t\t\t\t\t)\n\
379
- \t\t\t\t\t\t\t\t\t)\n\
380
- \t\t\t\t\t\t\t\t)\n\
381
- \t\t\t\t\t\t\t | \\1\\1\t\t\t\t\t\t\t\t# Must be bold closer\n\
382
- \t\t\t\t\t\t\t | (?!(?<=\\S)\\1).\t\t\t\t\t\t# Everything besides\n\
383
- \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# style closer\n\
384
- \t\t\t\t\t\t\t)++\n\
385
- \t\t\t\t\t\t\t(?<=\\S)\\1\t\t\t\t\t\t\t\t# Close\n\
386
- \t\t\t\t\t\t)\n\
387
- \t\t\t\t\t"
388
342
  end: (?<=\S)(\1)((?!\1)|(?=\1\1))
389
343
  patterns:
390
344
  - begin: (?=<[^>]*?>)
@@ -404,79 +358,91 @@ repository:
404
358
  - include: "#image-ref"
405
359
  - include: "#link-ref-literal"
406
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)://.*?)(>)
407
379
  line-break:
408
380
  name: meta.dummy.line-break
409
381
  match: " {2,}$"
410
382
  ampersand:
411
383
  name: meta.other.valid-ampersand.markdown
412
- match: "&(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)"
413
384
  comment: "\n\
414
385
  \t\t\t\tMarkdown will convert this for us. We match it so that the\n\
415
386
  \t\t\t\tHTML grammar will not mark it up as invalid.\n\
416
387
  \t\t\t"
388
+ match: "&(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)"
417
389
  uuid: 0A1D9874-B448-11D9-BD50-000D93B6E43C
418
- foldingStartMarker: |-
419
- (?x)
420
- (<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\b.*?>
421
- |<!--(?!.*-->)
422
- |\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/)))
423
- )
424
390
  patterns:
425
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"
426
397
  begin: |-
427
398
  (?x)^
428
399
  (?= [ ]{,3}>.
429
- | ([ ]{4}|\t)
400
+ | ([ ]{4}|\t)(?!$)
430
401
  | [#]{1,6}\s*+
431
- | [ ]{,3}(?<marker>[-*_])([ ]{,2}\g<marker>){2,}[ \t]*+$
402
+ | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
432
403
  )
433
404
  end: |-
434
405
  (?x)^
435
406
  (?! [ ]{,3}>.
436
407
  | ([ ]{4}|\t)
437
408
  | [#]{1,6}\s*+
438
- | [ ]{,3}(?<marker>[-*_])([ ]{,2}\g<marker>){2,}[ \t]*+$
409
+ | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
439
410
  )
440
411
  patterns:
441
412
  - include: "#block_quote"
442
413
  - include: "#block_raw"
443
414
  - include: "#heading"
444
415
  - include: "#separator"
445
- comment: "\n\
446
- \t\t\t\tWe could also use an empty end match and set\n\
447
- \t\t\t\tapplyEndPatternLast, but then we must be sure that the begin\n\
448
- \t\t\t\tpattern will only match stuff matched by the sub-patterns.\n\
449
- \t\t\t"
450
- - name: markup.list.unnumbered
416
+ - name: markup.list.unnumbered.markdown
417
+ begin: ^[ ]{0,3}([*+-])(?=\s)
451
418
  captures:
452
419
  "1":
453
420
  name: punctuation.definition.list_item.markdown
454
- begin: ^[ ]{0,3}([*+-])(?=\s)
455
421
  end: ^(?=\S)
456
422
  patterns:
457
423
  - include: "#list-paragraph"
458
- - name: markup.list.numbered
424
+ - name: markup.list.numbered.markdown
425
+ begin: ^[ ]{0,3}([0-9]+\.)(?=\s)
459
426
  captures:
460
427
  "1":
461
428
  name: punctuation.definition.list_item.markdown
462
- begin: ^[ ]{0,3}[0-9]+(\.)(?=\s)
463
429
  end: ^(?=\S)
464
430
  patterns:
465
431
  - include: "#list-paragraph"
466
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"
467
436
  begin: ^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)(?!.*?</\1>)
468
437
  end: (?<=^</\1>$\n)
469
438
  patterns:
470
439
  - include: text.html.basic
471
- comment: "\n\
472
- \t\t\t\tMarkdown formatting is disabled inside block-level tags.\n\
473
- \t\t\t"
474
440
  - name: meta.disable-markdown
441
+ comment: Same rule but for one line disables.
475
442
  begin: ^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)
476
443
  end: $\n?
477
444
  patterns:
478
445
  - include: text.html.basic
479
- comment: Same rule but for one line disables.
480
446
  - name: meta.link.reference.def.markdown
481
447
  captures:
482
448
  "6":
@@ -520,7 +486,7 @@ patterns:
520
486
  \t\t\t)"
521
487
  - name: meta.paragraph.markdown
522
488
  begin: ^(?=\S)(?![=-]{3,}(?=$))
523
- end: ^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ \t]*\n
489
+ end: ^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ \t]*\n|(?=^#)
524
490
  patterns:
525
491
  - include: "#inline"
526
492
  - include: text.html.basic
@@ -534,10 +500,20 @@ patterns:
534
500
  "1":
535
501
  name: punctuation.definition.heading.markdown
536
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
+ )
537
509
  foldingStopMarker: |-
538
510
  (?x)
539
511
  (</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)>
540
512
  |^\s*-->
541
513
  |(^|\s)\}
542
514
  )
543
- keyEquivalent: ^~M
515
+ fileTypes:
516
+ - mdown
517
+ - markdown
518
+ - markdn
519
+ - md