├── .gitignore
├── LICENSE
├── README.md
└── Syntaxes
├── Markdown Extended.JSON-tmLanguage
├── Markdown Extended.YAML-tmLanguage
├── Markdown Extended.sublime-syntax
├── Markdown Extended.tmLanguage
└── Symbol List - Heading.tmPreferences
/.gitignore:
--------------------------------------------------------------------------------
1 | *.cache
2 | tmp
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT Licence (MIT)
2 |
3 | Copyright (c) 2013-2015 Jon Schlinkert
4 |
5 | Permission is hereby granted, free of charge, to any person
6 | obtaining a copy of this software and associated documentation
7 | files (the "Software"), to deal in the Software without
8 | restriction, including without limitation the rights to use,
9 | copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the
11 | Software is furnished to do so, subject to the following
12 | conditions:
13 |
14 | The above copyright notice and this permission notice shall be
15 | included in all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 | OTHER DEALINGS IN THE SOFTWARE.
25 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # [sublime-markdown-extended](https://github.com/jonschlinkert/sublime-markdown-extended) [](https://packagecontrol.io/packages/Markdown%20Extended/)
2 |
3 | > Extends Soda's Monokai and the default markdown styles with additional syntax highlighting for
4 | > [YAML Front Matter](http://assemble.io/docs/YAML-front-matter.html), GitHub Flavored Markdown
5 | > (GFM) and language-specific syntax highlighting inside [GFM "fenced" code blocks](https://help.github.com/articles/github-flavored-markdown#syntax-highlighting)
6 |
7 | Although substantial changes have been made, thank you [@aziz](https://github.com/aziz) and other contributors to [Knockdown](https://github.com/aziz/knockdown), for the code for the fenced code blocks.
8 |
9 | Get [Monokai Extended](https://github.com/jonschlinkert/sublime-monokai-extended) for better highlighting.
10 |
11 | #### [Jump to Examples ↓](#markdown-enhancements)
12 |
13 |
14 | ## Getting Started
15 |
16 | ### 1. Installation
17 |
18 | #### Package Control
19 | If you already have [Package Control](http://wbond.net/sublime_packages/package_control/) installed in Sublime Text:
20 |
21 | * Select "Install Package" from the Command Palette: Ctrl+Shift+P on Windows and Linux or ⇧⌘P on OS X)
22 | * Search for "**Markdown Extended**" and click enter.
23 |
24 |
25 | #### Manual Installation
26 | Go to `Preferences -> Browse Packages`, and then either download and unzip this plugin into that directory, or:
27 |
28 | ``` bash
29 | git clone https://github.com/jonschlinkert/sublime-markdown-extended.git "sublime-markdown-extended"
30 | ```
31 |
32 | ### 2. Activate this Language
33 | **After installing this package**, open a markdown file and switch the language to `Markdown Extended`, using one
34 | of the following methods:
35 |
36 | * Select from the list of supported languages in your status bar at the bottom right corner of your editor
37 | * `ctrl + shift + p` and search for "Markdown Extended"
38 |
39 | ### 3. Make "Markdown Extended" the default
40 | To make `Markdown Extended` the default highlighting for the current extension:
41 |
42 | 1. Open a file with the extension you want to set a default for (i.e. `.md`)
43 | 2. Navigate through the following menus in Sublime Text: `View -> Syntax -> Open all with current extension as... -> Markdown Extended`
44 |
45 |
46 |
51 |
52 |
53 | ## Features:
54 | * Support for [YAML Front Matter](http://assemble.io/docs/YAML-front-matter.html)
55 | * Support for [GFM "fenced" code blocks](https://help.github.com/articles/github-flavored-markdown#syntax-highlighting)
56 | * Language-specific syntax highlighting support inside [GFM "fenced" code blocks](https://help.github.com/articles/github-flavored-markdown#syntax-highlighting) for most popular languages (see below for the list of supported languages)
57 | * Syntax highlighting for URLs in text which is auto-linked by GFM
58 | * Proper syntax highlighting for bullets and numbers in ordered/unordered lists
59 | * Proper syntax highlighting for bold and italics by ignoring multiple underscores in words
60 |
61 |
62 | ## Markdown Enhancements
63 | The following examples use the [Monokai Extended](https://github.com/jonschlinkert/sublime-monokai-extended) theme.
64 |
65 |
66 | ## Whitespace
67 |
68 | ### Significant whitespace
69 |
70 | **Whitespace is significant** _only directly before and directly after fenced code blocks_! Following these instructions will ensure that highlighting works properly and consistently._
71 |
72 | This is very simple:
73 |
74 | * **Add a newline** before and after clode blocks
75 | * **No trailing spaces** after the last code block
76 |
77 | If you don't, it won't break your code but it won't always look awesome.
78 |
79 | ### Comparisons with and without proper whitespace
80 |
81 | #### Whitespace before the block
82 | You will need to keep a space above and below fenced code blocks for predictable results with syntax highlighting. For example, this is what it looks like when there is no space before a fenced code block:
83 |
84 | 
85 |
86 | This is what it looks like with proper spacing:
87 |
88 | 
89 |
90 | #### Whitespace after the block
91 |
92 | Also add a new line after code blocks, but make sure that there is no trailing whitespace next to the bottom fence.
93 |
94 | **With a trailing whitespace**
95 |
96 | 
97 |
98 | **Without a trailing whitespace**
99 |
100 | 
101 |
102 | ### Supported languages
103 |
104 | The following languages are highlighted inside fenced code blocks:
105 |
106 | Note that in order for a language to be highlighted properly, you must have the language installed in Sublime Text.
107 |
108 | * `coffee|coffeescript`
109 | * `coffee front matter`
110 | * `cpp`
111 | * `csharp`
112 | * `css`
113 | * `c`
114 | * `c++`
115 | * `diff`
116 | * `ejs`
117 | * `erlang`
118 | * `underscore`
119 | * `go`
120 | * `graphql`
121 | * `lodash`
122 | * `handlebars|hbs`: requires the Sublime Text [Handlebars](https://github.com/daaain/Handlebars) package
123 | * `html|html5`
124 | * `ini`
125 | * `jade`
126 | * `java`
127 | * `javascript|js`
128 | * `json`
129 | * `json front matter`
130 | * `julia`
131 | * `less`
132 | * `ls|livescript|LiveScript`
133 | * `lua`
134 | * `md|markdown`
135 | * `nginx`
136 | * `objective-c`
137 | * `objective-c++`
138 | * `perl`
139 | * `r`
140 | * `ruby`
141 | * `sass`
142 | * `scala`
143 | * `scss`
144 | * `shell`
145 | * `bash`
146 | * `sql|ddl|dml`
147 | * `postgresql|postgres|pgsql`
148 | * `styl`
149 | * `swift`
150 | * `swig`
151 | * `liquid`
152 | * `xml`
153 | * `yaml`
154 | * `yaml front matter`
155 |
156 |
157 | ### CSS
158 | #### Before
159 | 
160 |
161 | #### After
162 | 
163 |
164 |
165 | ### LESS
166 | #### Before
167 | 
168 |
169 | #### After
170 | 
171 |
172 |
173 | ### HTML
174 | #### Before
175 | 
176 |
177 | #### After
178 | 
179 |
180 |
181 | ### JavaScript
182 | #### Before
183 | 
184 |
185 | #### After
186 | 
187 |
188 |
189 | ### Coffee
190 | #### Before
191 | 
192 |
193 | #### After
194 | 
195 |
196 |
197 | ### LiveScript
198 | #### Before
199 | 
200 | #### After
201 | 
202 |
203 |
204 | ### Shell
205 | #### Before
206 | 
207 |
208 | #### After
209 | 
210 |
211 | ### YAML Front Matter
212 | See [gray-matter](https://github.com/assemble/gray-matter)
213 |
214 | #### Before
215 | 
216 |
217 | #### After
218 | 
219 |
220 | ### Coffee Front Matter
221 | See [gray-matter](https://github.com/assemble/gray-matter)
222 |
223 | #### Before
224 | 
225 |
226 | #### After
227 | 
228 |
229 |
230 | ## Authors
231 |
232 | **Jon Schlinkert**
233 |
234 | + [http://twitter.com/jonschlinkert](http://twitter.com/jonschlinkert)
235 | + [http://github.com/jonschlinkert](http://github.com/jonschlinkert)
236 |
237 | **Alexander Krivoshhekov**
238 |
239 | + [http://twitter.com/FlatDev](http://twitter.com/FlatDev)
240 | + [http://github.com/SuperPaintman](http://github.com/SuperPaintman)
241 |
242 | ## Copyright and license
243 | Copyright 2013-2015 Jon Schlinkert
244 |
245 | [MIT License](LICENSE-MIT)
246 |
247 |
--------------------------------------------------------------------------------
/Syntaxes/Markdown Extended.JSON-tmLanguage:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Markdown Extended",
3 | "foldingStartMarker": "(?x)\n(<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\\b.*?>\n|)\n|\\{\\s*($|\\?>\\s*$|//|/\\*(.*\\*/\\s*$|(?!.*?\\*/)))\n)",
4 | "scopeName": "text.html.markdown",
5 | "foldingStopMarker": "(?x)\n((?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)>\n|^\\s*-->\n|(^|\\s)\\}\n)",
6 | "uuid": "dd477cf1-34c4-49d2-ba09-f8445676ccd4",
7 | "repository": {
8 | "bold": {
9 | "name": "markup.bold.markdown",
10 | "end": "(?<=\\S)(\\1)",
11 | "begin": "(?x)\n(\\*\\*|__)(?=\\S) # Open\n(?=\n (\n <[^>]*+> # HTML tags\n | (?`+)([^`]|(?!(?(?!`))`)*+\\k\n # Raw\n | \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+ # Escapes\n | \\[\n (\n (? # Named group\n [^\\[\\]\\\\] # Match most chars\n | \\\\. # Escaped chars\n | \\[ \\g*+ \\] # Nested brackets\n )*+\n \\]\n (\n ( # Reference Link\n [ ]? # Optional space\n \\[[^\\]]*+\\] # Ref name\n )\n | ( # Inline Link\n \\( # Opening paren\n [ \\t]*+ # Optional whtiespace\n (.*?)>? # URL\n [ \\t]*+ # Optional whtiespace\n ( # Optional Title\n (?['\"])\n (.*?)\n \\k\n )?\n \\)\n )\n )\n )\n | (?!(?<=\\S)\\1). # Everything besides\n # style closer\n )++\n (?<=\\S)\\1 # Close\n)",
12 | "patterns": [
13 | {
14 | "end": "(?<=>)",
15 | "patterns": [
16 | {
17 | "include": "text.html.handlebars"
18 | }
19 | ],
20 | "applyEndPatternLast": 1,
21 | "begin": "(?=<[^>]*?>)"
22 | },
23 | {
24 | "include": "#escape"
25 | },
26 | {
27 | "include": "#ampersand"
28 | },
29 | {
30 | "include": "#bracket"
31 | },
32 | {
33 | "include": "#raw"
34 | },
35 | {
36 | "include": "#italic"
37 | },
38 | {
39 | "include": "#strike"
40 | },
41 | {
42 | "include": "#image-inline"
43 | },
44 | {
45 | "include": "#link-inline"
46 | },
47 | {
48 | "include": "#link-inet"
49 | },
50 | {
51 | "include": "#link-email"
52 | },
53 | {
54 | "include": "#image-ref"
55 | },
56 | {
57 | "include": "#link-ref-literal"
58 | },
59 | {
60 | "include": "#link-ref"
61 | }
62 | ],
63 | "captures": {
64 | "1": {
65 | "name": "punctuation.definition.bold.markdown"
66 | }
67 | }
68 | },
69 | "link-inet": {
70 | "name": "meta.link.inet.markdown",
71 | "match": "(<)((?:https?|ftp)://.*?)(>)",
72 | "captures": {
73 | "1": {
74 | "name": "punctuation.definition.link.markdown"
75 | },
76 | "2": {
77 | "name": "markup.underline.link.markdown"
78 | },
79 | "3": {
80 | "name": "punctuation.definition.link.markdown"
81 | }
82 | }
83 | },
84 | "link-inline": {
85 | "name": "meta.link.inline.markdown",
86 | "match": "(?x:\n (\\[)((?[^\\[\\]\\\\]|\\\\.|\\[\\g*+\\])*+)(\\])\n # Match the link text.\n ([ ])? # Space not allowed\n (\\() # Opening paren for url\n ()(.*?)(>?) # The url\n [ \\t]* # Optional whitespace\n (?:\n ((\\().+?(\\))) # Match title in parens\u2026\n | ((\").+?(\")) # or in quotes.\n )? # Title is optional\n \\s* # Optional whitespace\n (\\))\n )",
87 | "captures": {
88 | "4": {
89 | "name": "punctuation.definition.string.end.markdown"
90 | },
91 | "5": {
92 | "name": "invalid.illegal.whitespace.markdown"
93 | },
94 | "6": {
95 | "name": "punctuation.definition.metadata.markdown"
96 | },
97 | "7": {
98 | "name": "punctuation.definition.link.markdown"
99 | },
100 | "10": {
101 | "name": "string.other.link.description.title.markdown"
102 | },
103 | "1": {
104 | "name": "punctuation.definition.string.begin.markdown"
105 | },
106 | "2": {
107 | "name": "string.other.link.title.markdown"
108 | },
109 | "12": {
110 | "name": "punctuation.definition.string.end.markdown"
111 | },
112 | "13": {
113 | "name": "string.other.link.description.title.markdown"
114 | },
115 | "8": {
116 | "name": "markup.underline.link.markdown"
117 | },
118 | "9": {
119 | "name": "punctuation.definition.link.markdown"
120 | },
121 | "16": {
122 | "name": "punctuation.definition.metadata.markdown"
123 | },
124 | "15": {
125 | "name": "punctuation.definition.string.end.markdown"
126 | },
127 | "14": {
128 | "name": "punctuation.definition.string.begin.markdown"
129 | },
130 | "11": {
131 | "name": "punctuation.definition.string.begin.markdown"
132 | }
133 | }
134 | },
135 | "image-inline": {
136 | "name": "meta.image.inline.markdown",
137 | "match": "(?x:\n \\! # Images start with !\n (\\[)((?[^\\[\\]\\\\]|\\\\.|\\[\\g*+\\])*+)(\\])\n # Match the link text.\n ([ ])? # Space not allowed\n (\\() # Opening paren for url\n ()(\\S+?)(>?) # The url\n [ \\t]* # Optional whitespace\n (?:\n ((\\().+?(\\))) # Match title in parens\u2026\n | ((\").+?(\")) # or in quotes.\n )? # Title is optional\n \\s* # Optional whitespace\n (\\))\n )",
138 | "captures": {
139 | "4": {
140 | "name": "punctuation.definition.string.end.markdown"
141 | },
142 | "5": {
143 | "name": "invalid.illegal.whitespace.markdown"
144 | },
145 | "6": {
146 | "name": "punctuation.definition.metadata.markdown"
147 | },
148 | "7": {
149 | "name": "punctuation.definition.link.markdown"
150 | },
151 | "10": {
152 | "name": "string.other.link.description.title.markdown"
153 | },
154 | "1": {
155 | "name": "punctuation.definition.string.begin.markdown"
156 | },
157 | "2": {
158 | "name": "string.other.link.description.markdown"
159 | },
160 | "12": {
161 | "name": "punctuation.definition.string.markdown"
162 | },
163 | "13": {
164 | "name": "string.other.link.description.title.markdown"
165 | },
166 | "8": {
167 | "name": "markup.underline.link.image.markdown"
168 | },
169 | "9": {
170 | "name": "punctuation.definition.link.markdown"
171 | },
172 | "16": {
173 | "name": "punctuation.definition.metadata.markdown"
174 | },
175 | "15": {
176 | "name": "punctuation.definition.string.markdown"
177 | },
178 | "14": {
179 | "name": "punctuation.definition.string.markdown"
180 | },
181 | "11": {
182 | "name": "punctuation.definition.string.markdown"
183 | }
184 | }
185 | },
186 | "ampersand": {
187 | "name": "meta.other.valid-ampersand.markdown",
188 | "match": "&(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)",
189 | "comment": "\n Markdown will convert this for us. We match it so that the\n HTML grammar will not mark it up as invalid.\n "
190 | },
191 | "escape": {
192 | "name": "constant.character.escape.markdown",
193 | "match": "\\\\[-`*_#+.!(){}\\[\\]\\\\>]"
194 | },
195 | "italic": {
196 | "name": "markup.italic.markdown",
197 | "end": "(?<=\\S)(\\1)((?!\\1)|(?=\\1\\1))",
198 | "begin": "(?x)\n(\\*|_)(?=\\S) # Open\n(?=\n (\n <[^>]*+> # HTML tags\n | (?`+)([^`]|(?!(?(?!`))`)*+\\k\n # Raw\n | \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+ # Escapes\n | \\[\n (\n (? # Named group\n [^\\[\\]\\\\] # Match most chars\n | \\\\. # Escaped chars\n | \\[ \\g*+ \\] # Nested brackets\n )*+\n \\]\n (\n ( # Reference Link\n [ ]? # Optional space\n \\[[^\\]]*+\\] # Ref name\n )\n | ( # Inline Link\n \\( # Opening paren\n [ \\t]*+ # Optional whtiespace\n (.*?)>? # URL\n [ \\t]*+ # Optional whtiespace\n ( # Optional Title\n (?['\"])\n (.*?)\n \\k\n )?\n \\)\n )\n )\n )\n | \\1\\1 # Must be bold closer\n | (?!(?<=\\S)\\1). # Everything besides\n # style closer\n )++\n (?<=\\S)\\1 # Close\n)",
199 | "patterns": [
200 | {
201 | "end": "(?<=>)",
202 | "patterns": [
203 | {
204 | "include": "text.html.handlebars"
205 | }
206 | ],
207 | "applyEndPatternLast": 1,
208 | "begin": "(?=<[^>]*?>)"
209 | },
210 | {
211 | "include": "#escape"
212 | },
213 | {
214 | "include": "#ampersand"
215 | },
216 | {
217 | "include": "#bracket"
218 | },
219 | {
220 | "include": "#raw"
221 | },
222 | {
223 | "include": "#bold"
224 | },
225 | {
226 | "include": "#strike"
227 | },
228 | {
229 | "include": "#image-inline"
230 | },
231 | {
232 | "include": "#link-inline"
233 | },
234 | {
235 | "include": "#link-inet"
236 | },
237 | {
238 | "include": "#link-email"
239 | },
240 | {
241 | "include": "#image-ref"
242 | },
243 | {
244 | "include": "#link-ref-literal"
245 | },
246 | {
247 | "include": "#link-ref"
248 | }
249 | ],
250 | "captures": {
251 | "1": {
252 | "name": "punctuation.definition.italic.markdown"
253 | }
254 | }
255 | },
256 | "strike": {
257 | "name": "markup.strike.markdown",
258 | "end": "(?<=\\S)(\\1)((?!\\1)|(?=\\1\\1))",
259 | "begin": "(?x)\n(~~)(?=\\S) # Open\n(?=\n (\n <[^>]*+> # HTML tags\n | (?`+)([^`]|(?!(?(?!`))`)*+\\k\n # Raw\n | \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+ # Escapes\n | \\[\n (\n (? # Named group\n [^\\[\\]\\\\] # Match most chars\n | \\\\. # Escaped chars\n | \\[ \\g*+ \\] # Nested brackets\n )*+\n \\]\n (\n ( # Reference Link\n [ ]? # Optional space\n \\[[^\\]]*+\\] # Ref name\n )\n | ( # Inline Link\n \\( # Opening paren\n [ \\t]*+ # Optional whtiespace\n (.*?)>? # URL\n [ \\t]*+ # Optional whtiespace\n ( # Optional Title\n (?['\"])\n (.*?)\n \\k\n )?\n \\)\n )\n )\n )\n | \\1\\1 # Must be bold closer\n | (?!(?<=\\S)\\1). # Everything besides\n # style closer\n )++\n (?<=\\S)\\1 # Close\n)",
260 | "patterns": [
261 | {
262 | "end": "(?<=>)",
263 | "patterns": [
264 | {
265 | "include": "text.html.handlebars"
266 | }
267 | ],
268 | "applyEndPatternLast": 1,
269 | "begin": "(?=<[^>]*?>)"
270 | },
271 | {
272 | "include": "#escape"
273 | },
274 | {
275 | "include": "#ampersand"
276 | },
277 | {
278 | "include": "#bracket"
279 | },
280 | {
281 | "include": "#raw"
282 | },
283 | {
284 | "include": "#bold"
285 | },
286 | {
287 | "include": "#italic"
288 | },
289 | {
290 | "include": "#image-inline"
291 | },
292 | {
293 | "include": "#link-inline"
294 | },
295 | {
296 | "include": "#link-inet"
297 | },
298 | {
299 | "include": "#link-email"
300 | },
301 | {
302 | "include": "#image-ref"
303 | },
304 | {
305 | "include": "#link-ref-literal"
306 | },
307 | {
308 | "include": "#link-ref"
309 | }
310 | ],
311 | "captures": {
312 | "1": {
313 | "name": "punctuation.definition.strike.markdown"
314 | }
315 | }
316 | },
317 | "line-break": {
318 | "name": "meta.dummy.line-break",
319 | "match": " {2,}$"
320 | },
321 | "raw": {
322 | "name": "markup.raw.inline.markdown",
323 | "match": "(`+)([^`]|(?!(?[^\\[\\]\\\\]|\\\\.|\\[\\g*+\\])*+)(\\])[ ]?(\\[)(.*?)(\\])",
499 | "captures": {
500 | "4": {
501 | "name": "punctuation.definition.string.begin.markdown"
502 | },
503 | "5": {
504 | "name": "punctuation.definition.constant.markdown"
505 | },
506 | "6": {
507 | "name": "constant.other.reference.link.markdown"
508 | },
509 | "7": {
510 | "name": "punctuation.definition.constant.markdown"
511 | },
512 | "1": {
513 | "name": "punctuation.definition.string.begin.markdown"
514 | },
515 | "2": {
516 | "name": "string.other.link.description.markdown"
517 | }
518 | }
519 | },
520 | "link-email": {
521 | "name": "meta.link.email.lt-gt.markdown",
522 | "match": "(<)((?:mailto:)?[-.\\w]+@[-a-z0-9]+(\\.[-a-z0-9]+)*\\.[a-z]+)(>)",
523 | "captures": {
524 | "4": {
525 | "name": "punctuation.definition.link.markdown"
526 | },
527 | "1": {
528 | "name": "punctuation.definition.link.markdown"
529 | },
530 | "2": {
531 | "name": "markup.underline.link.markdown"
532 | }
533 | }
534 | },
535 | "list-paragraph": {
536 | "patterns": [
537 | {
538 | "name": "meta.paragraph.list.markdown",
539 | "end": "^\\s*$",
540 | "patterns": [
541 | {
542 | "include": "#inline"
543 | }
544 | ],
545 | "begin": "\\G\\s+(?=\\S)"
546 | }
547 | ]
548 | },
549 | "link-ref": {
550 | "name": "meta.link.reference.markdown",
551 | "match": "(\\[)((?[^\\[\\]\\\\]|\\\\.|\\[\\g*+\\])*+)(\\])[ ]?(\\[)([^\\]]*+)(\\])",
552 | "captures": {
553 | "4": {
554 | "name": "punctuation.definition.string.end.markdown"
555 | },
556 | "5": {
557 | "name": "punctuation.definition.constant.begin.markdown"
558 | },
559 | "6": {
560 | "name": "constant.other.reference.link.markdown"
561 | },
562 | "7": {
563 | "name": "punctuation.definition.constant.end.markdown"
564 | },
565 | "1": {
566 | "name": "punctuation.definition.string.begin.markdown"
567 | },
568 | "2": {
569 | "name": "string.other.link.title.markdown"
570 | }
571 | }
572 | },
573 | "bracket": {
574 | "name": "meta.other.valid-bracket.markdown",
575 | "match": "<(?![a-z/?\\$!])",
576 | "comment": "\n Markdown will convert this for us. We match it so that the\n HTML grammar will not mark it up as invalid.\n "
577 | },
578 | "link-ref-literal": {
579 | "name": "meta.link.reference.literal.markdown",
580 | "match": "(\\[)((?[^\\[\\]\\\\]|\\\\.|\\[\\g*+\\])*+)(\\])[ ]?(\\[)(\\])",
581 | "captures": {
582 | "4": {
583 | "name": "punctuation.definition.string.end.markdown"
584 | },
585 | "5": {
586 | "name": "punctuation.definition.constant.begin.markdown"
587 | },
588 | "6": {
589 | "name": "punctuation.definition.constant.end.markdown"
590 | },
591 | "1": {
592 | "name": "punctuation.definition.string.begin.markdown"
593 | },
594 | "2": {
595 | "name": "string.other.link.title.markdown"
596 | }
597 | }
598 | },
599 | "block_quote": {
600 | "name": "markup.quote.markdown",
601 | "end": "(?x)^\n(?= \\s*$\n| [ ]{,3}(?[-*_])([ ]{,2}\\k){2,}[ \\t]*+$\n| [ ]{,3}>.\n)",
602 | "patterns": [
603 | {
604 | "end": "^",
605 | "patterns": [
606 | {
607 | "include": "#block_quote"
608 | }
609 | ],
610 | "begin": "(?x)\\G\n(?= [ ]{,3}>.\n)"
611 | },
612 | {
613 | "end": "^",
614 | "patterns": [
615 | {
616 | "include": "#block_raw"
617 | },
618 | {
619 | "include": "#heading"
620 | },
621 | {
622 | "include": "#separator"
623 | }
624 | ],
625 | "applyEndPatternLast": 1,
626 | "begin": "(?x)\\G\n(?= ([ ]{4}|\\t)\n| [#]{1,6}\\s*+\n| [ ]{,3}(?[-*_])([ ]{,2}\\k){2,}[ \\t]*+$\n)"
627 | },
628 | {
629 | "end": "$|(?<=\\n)",
630 | "patterns": [
631 | {
632 | "include": "#inline"
633 | }
634 | ],
635 | "begin": "(?x)\\G\n(?! $\n| [ ]{,3}>.\n| ([ ]{4}|\\t)\n| [#]{1,6}\\s*+\n| [ ]{,3}(?[-*_])([ ]{,2}\\k){2,}[ \\t]*+$\n)"
636 | }
637 | ],
638 | "comment": "\n We terminate the block quote when seeing an empty line, a\n separator or a line with leading > characters. The latter is\n to \u201creset\u201d the quote level for quoted lines.\n ",
639 | "begin": "\\G[ ]{,3}(>)(?!$)[ ]?",
640 | "beginCaptures": {
641 | "1": {
642 | "name": "punctuation.definition.blockquote.markdown"
643 | }
644 | }
645 | }
646 | },
647 | "patterns": [
648 | {
649 | "name": "markup.raw.yaml.front-matter",
650 | "end": "^---\\s",
651 | "patterns": [
652 | {
653 | "include": "source.yaml"
654 | }
655 | ],
656 | "begin": "(?.\n| ([ ]{4}|\\t)\n| [#]{1,6}\\s*+\n| [ ]{,3}(?[-*_])([ ]{,2}\\k){2,}[ \\t]*+$\n)",
681 | "patterns": [
682 | {
683 | "include": "#block_quote"
684 | },
685 | {
686 | "include": "#block_raw"
687 | },
688 | {
689 | "include": "#heading"
690 | },
691 | {
692 | "include": "#separator"
693 | }
694 | ],
695 | "comment": "\n We could also use an empty end match and set\n applyEndPatternLast, but then we must be sure that the begin\n pattern will only match stuff matched by the sub-patterns.\n ",
696 | "begin": "(?x)^\n(?= [ ]{,3}>.\n| ([ ]{4}|\\t)(?!$)\n| [#]{1,6}\\s*+\n| [ ]{,3}(?[-*_])([ ]{,2}\\k){2,}[ \\t]*+$\n)"
697 | },
698 | {
699 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
700 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
701 | "begin": "(```|~~~|{%\\s*highlight)\\s*(c)\\s*((?:linenos\\s*)?%})?$",
702 | "patterns": [
703 | {
704 | "include": "source.c"
705 | }
706 | ],
707 | "captures": {
708 | "1": {
709 | "name": "punctuation.definition.fenced.markdown"
710 | },
711 | "2": {
712 | "name": "variable.language.fenced.markdown"
713 | },
714 | "3": {
715 | "name": "punctuation.definition.fenced.markdown"
716 | }
717 | }
718 | },
719 | {
720 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
721 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
722 | "begin": "(```|~~~|{%\\s*highlight)\\s*(cpp)\\s*((?:linenos\\s*)?%})?$",
723 | "patterns": [
724 | {
725 | "include": "source.c++"
726 | }
727 | ],
728 | "captures": {
729 | "1": {
730 | "name": "punctuation.definition.fenced.markdown"
731 | },
732 | "2": {
733 | "name": "variable.language.fenced.markdown"
734 | },
735 | "3": {
736 | "name": "punctuation.definition.fenced.markdown"
737 | }
738 | }
739 | },
740 | {
741 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
742 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
743 | "begin": "(```|~~~|{%\\s*highlight)\\s*(coffee|coffeescript)\\s*((?:linenos\\s*)?%})?$",
744 | "patterns": [
745 | {
746 | "include": "source.coffee"
747 | }
748 | ],
749 | "captures": {
750 | "1": {
751 | "name": "punctuation.definition.fenced.markdown"
752 | },
753 | "2": {
754 | "name": "variable.language.fenced.markdown"
755 | },
756 | "3": {
757 | "name": "punctuation.definition.fenced.markdown"
758 | }
759 | }
760 | },
761 | {
762 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
763 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
764 | "begin": "(```|~~~|{%\\s*highlight)\\s*(jade)\\s*((?:linenos\\s*)?%})?$",
765 | "patterns": [
766 | {
767 | "include": "source.jade"
768 | }
769 | ],
770 | "captures": {
771 | "1": {
772 | "name": "punctuation.definition.fenced.markdown"
773 | },
774 | "2": {
775 | "name": "variable.language.fenced.markdown"
776 | },
777 | "3": {
778 | "name": "punctuation.definition.fenced.markdown"
779 | }
780 | }
781 | },
782 | {
783 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
784 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
785 | "begin": "(```|~~~|{%\\s*highlight)\\s*(css)\\s*((?:linenos\\s*)?%})?$",
786 | "patterns": [
787 | {
788 | "include": "source.css"
789 | }
790 | ],
791 | "captures": {
792 | "1": {
793 | "name": "punctuation.definition.fenced.markdown"
794 | },
795 | "2": {
796 | "name": "variable.language.fenced.markdown"
797 | },
798 | "3": {
799 | "name": "punctuation.definition.fenced.markdown"
800 | }
801 | }
802 | },
803 | {
804 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
805 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
806 | "begin": "(```|~~~|{%\\s*highlight)\\s*(csharp)\\s*((?:linenos\\s*)?%})?$",
807 | "patterns": [
808 | {
809 | "include": "source.cs"
810 | }
811 | ],
812 | "captures": {
813 | "1": {
814 | "name": "punctuation.definition.fenced.markdown"
815 | },
816 | "2": {
817 | "name": "variable.language.fenced.markdown"
818 | },
819 | "3": {
820 | "name": "punctuation.definition.fenced.markdown"
821 | }
822 | }
823 | },
824 | {
825 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
826 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
827 | "begin": "(```|~~~|{%\\s*highlight)\\s*(ejs|underscore|lodash)\\s*((?:linenos\\s*)?%})?$",
828 | "patterns": [
829 | {
830 | "include": "source.ejs"
831 | }
832 | ],
833 | "captures": {
834 | "1": {
835 | "name": "punctuation.definition.fenced.markdown"
836 | },
837 | "2": {
838 | "name": "variable.language.fenced.markdown"
839 | },
840 | "3": {
841 | "name": "punctuation.definition.fenced.markdown"
842 | }
843 | }
844 | },
845 | {
846 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
847 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
848 | "begin": "(```|~~~|{%\\s*highlight)\\s*(erlang)\\s*((?:linenos\\s*)?%})?$",
849 | "patterns": [
850 | {
851 | "include": "source.erlang"
852 | }
853 | ],
854 | "captures": {
855 | "1": {
856 | "name": "punctuation.definition.fenced.markdown"
857 | },
858 | "2": {
859 | "name": "variable.language.fenced.markdown"
860 | },
861 | "3": {
862 | "name": "punctuation.definition.fenced.markdown"
863 | }
864 | }
865 | },
866 | {
867 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
868 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
869 | "begin": "(```|~~~|{%\\s*highlight)\\s*(diff)\\s*((?:linenos\\s*)?%})?$",
870 | "patterns": [
871 | {
872 | "include": "source.diff"
873 | }
874 | ],
875 | "captures": {
876 | "1": {
877 | "name": "punctuation.definition.fenced.markdown"
878 | },
879 | "2": {
880 | "name": "variable.language.fenced.markdown"
881 | },
882 | "3": {
883 | "name": "punctuation.definition.fenced.markdown"
884 | }
885 | }
886 | },
887 | {
888 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
889 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
890 | "begin": "(```|~~~|{%\\s*highlight)\\s*(go|golang)\\s*((?:linenos\\s*)?%})?$",
891 | "patterns": [
892 | {
893 | "include": "source.go"
894 | }
895 | ],
896 | "captures": {
897 | "1": {
898 | "name": "punctuation.definition.fenced.markdown"
899 | },
900 | "2": {
901 | "name": "variable.language.fenced.markdown"
902 | },
903 | "3": {
904 | "name": "punctuation.definition.fenced.markdown"
905 | }
906 | }
907 | },
908 | {
909 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
910 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
911 | "begin": "(```|~~~|{%\\s*highlight)\\s*(graphql)\\s*((?:linenos\\s*)?%})?$",
912 | "patterns": [
913 | {
914 | "include": "source.graphql"
915 | }
916 | ],
917 | "captures": {
918 | "1": {
919 | "name": "punctuation.definition.fenced.markdown"
920 | },
921 | "2": {
922 | "name": "variable.language.fenced.markdown"
923 | },
924 | "3": {
925 | "name": "punctuation.definition.fenced.markdown"
926 | }
927 | }
928 | },
929 | {
930 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
931 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
932 | "begin": "(```|~~~|{%\\s*highlight)\\s*(hbs|handlebars|html|html5)\\s*((?:linenos\\s*)?%})?$",
933 | "patterns": [
934 | {
935 | "include": "text.html.basic"
936 | },
937 | {
938 | "include": "text.html.handlebars"
939 | }
940 | ],
941 | "captures": {
942 | "1": {
943 | "name": "punctuation.definition.fenced.markdown"
944 | },
945 | "2": {
946 | "name": "variable.language.fenced.markdown"
947 | },
948 | "3": {
949 | "name": "punctuation.definition.fenced.markdown"
950 | }
951 | }
952 | },
953 | {
954 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
955 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
956 | "begin": "(```|~~~|{%\\s*highlight)\\s*(ini)\\s*((?:linenos\\s*)?%})?$",
957 | "patterns": [
958 | {
959 | "include": "source.ini"
960 | }
961 | ],
962 | "captures": {
963 | "1": {
964 | "name": "punctuation.definition.fenced.markdown"
965 | },
966 | "2": {
967 | "name": "variable.language.fenced.markdown"
968 | },
969 | "3": {
970 | "name": "punctuation.definition.fenced.markdown"
971 | }
972 | }
973 | },
974 | {
975 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
976 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
977 | "begin": "(```|~~~|{%\\s*highlight)\\s*(java)\\s*((?:linenos\\s*)?%})?$",
978 | "patterns": [
979 | {
980 | "include": "source.java"
981 | }
982 | ],
983 | "captures": {
984 | "1": {
985 | "name": "punctuation.definition.fenced.markdown"
986 | },
987 | "2": {
988 | "name": "variable.language.fenced.markdown"
989 | },
990 | "3": {
991 | "name": "punctuation.definition.fenced.markdown"
992 | }
993 | }
994 | },
995 | {
996 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
997 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
998 | "begin": "(```|~~~|{%\\s*highlight)\\s*(javascript|js)\\s*((?:linenos\\s*)?%})?$",
999 | "patterns": [
1000 | {
1001 | "include": "source.js"
1002 | }
1003 | ],
1004 | "captures": {
1005 | "1": {
1006 | "name": "punctuation.definition.fenced.markdown"
1007 | },
1008 | "2": {
1009 | "name": "variable.language.fenced.markdown"
1010 | },
1011 | "3": {
1012 | "name": "punctuation.definition.fenced.markdown"
1013 | }
1014 | }
1015 | },
1016 | {
1017 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1018 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1019 | "begin": "(```|~~~|{%\\s*highlight)\\s*(json)\\s*((?:linenos\\s*)?%})?$",
1020 | "patterns": [
1021 | {
1022 | "include": "source.json"
1023 | }
1024 | ],
1025 | "captures": {
1026 | "1": {
1027 | "name": "punctuation.definition.fenced.markdown"
1028 | },
1029 | "2": {
1030 | "name": "variable.language.fenced.markdown"
1031 | },
1032 | "3": {
1033 | "name": "punctuation.definition.fenced.markdown"
1034 | }
1035 | }
1036 | },
1037 | {
1038 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1039 | "end": "(```|{%\\s*endhighlight\\s*%})\\n",
1040 | "begin": "(```|{%\\s*highlight)\\s*(julia|jl)\\s*((?:linenos\\s*)?%})?$",
1041 | "patterns": [
1042 | {
1043 | "include": "source.julia"
1044 | }
1045 | ],
1046 | "captures": {
1047 | "1": {
1048 | "name": "punctuation.definition.fenced.markdown"
1049 | },
1050 | "2": {
1051 | "name": "variable.language.fenced.markdown"
1052 | },
1053 | "3": {
1054 | "name": "punctuation.definition.fenced.markdown"
1055 | }
1056 | }
1057 | },
1058 | {
1059 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1060 | "end": "(```|{%\\s*endhighlight\\s*%})\\n",
1061 | "begin": "(```|{%\\s*highlight)\\s*(less)\\s*((?:linenos\\s*)?%})?$",
1062 | "patterns": [
1063 | {
1064 | "include": "source.css.less"
1065 | }
1066 | ],
1067 | "captures": {
1068 | "1": {
1069 | "name": "punctuation.definition.fenced.markdown"
1070 | },
1071 | "2": {
1072 | "name": "variable.language.fenced.markdown"
1073 | },
1074 | "3": {
1075 | "name": "punctuation.definition.fenced.markdown"
1076 | }
1077 | }
1078 | },
1079 | {
1080 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1081 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1082 | "begin": "(```|~~~|{%\\s*highlight)\\s*(ls|livescript|LiveScript)\\s*((?:linenos\\s*)?%})?$",
1083 | "patterns": [
1084 | {
1085 | "include": "source.livescript"
1086 | }
1087 | ],
1088 | "captures": {
1089 | "1": {
1090 | "name": "punctuation.definition.fenced.markdown"
1091 | },
1092 | "2": {
1093 | "name": "variable.language.fenced.markdown"
1094 | },
1095 | "3": {
1096 | "name": "punctuation.definition.fenced.markdown"
1097 | }
1098 | }
1099 | },
1100 | {
1101 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1102 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1103 | "begin": "(```|~~~|{%\\s*highlight)\\s*(lua)\\s*((?:linenos\\s*)?%})?$",
1104 | "patterns": [
1105 | {
1106 | "include": "source.lua"
1107 | }
1108 | ],
1109 | "captures": {
1110 | "1": {
1111 | "name": "punctuation.definition.fenced.markdown"
1112 | },
1113 | "2": {
1114 | "name": "variable.language.fenced.markdown"
1115 | },
1116 | "3": {
1117 | "name": "punctuation.definition.fenced.markdown"
1118 | }
1119 | }
1120 | },
1121 | {
1122 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1123 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1124 | "begin": "(```|~~~|{%\\s*highlight)\\s*(md|markdown)\\s*((?:linenos\\s*)?%})?$",
1125 | "patterns": [
1126 | {
1127 | "include": "text.html.markdown"
1128 | }
1129 | ],
1130 | "captures": {
1131 | "1": {
1132 | "name": "punctuation.definition.fenced.markdown"
1133 | },
1134 | "2": {
1135 | "name": "variable.language.fenced.markdown"
1136 | },
1137 | "3": {
1138 | "name": "punctuation.definition.fenced.markdown"
1139 | }
1140 | }
1141 | },
1142 | {
1143 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1144 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1145 | "begin": "(```|~~~|{%\\s*highlight)\\s*(nginx)\\s*((?:linenos\\s*)?%})?$",
1146 | "patterns": [
1147 | {
1148 | "include": "source.nginx"
1149 | }
1150 | ],
1151 | "captures": {
1152 | "1": {
1153 | "name": "punctuation.definition.fenced.markdown"
1154 | },
1155 | "2": {
1156 | "name": "variable.language.fenced.markdown"
1157 | },
1158 | "3": {
1159 | "name": "punctuation.definition.fenced.markdown"
1160 | }
1161 | }
1162 | },
1163 | {
1164 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1165 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1166 | "begin": "(```|~~~|{%\\s*highlight)\\s*(swift)\\s*((?:linenos\\s*)?%})?$",
1167 | "patterns": [
1168 | {
1169 | "include": "source.swift"
1170 | }
1171 | ],
1172 | "captures": {
1173 | "1": {
1174 | "name": "punctuation.definition.fenced.markdown"
1175 | },
1176 | "2": {
1177 | "name": "variable.language.fenced.markdown"
1178 | },
1179 | "3": {
1180 | "name": "punctuation.definition.fenced.markdown"
1181 | }
1182 | }
1183 | },
1184 | {
1185 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1186 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1187 | "begin": "(```|~~~|{%\\s*highlight)\\s*(obj(?:ective\\-|)c)\\s*((?:linenos\\s*)?%})?$",
1188 | "patterns": [
1189 | {
1190 | "include": "source.objc"
1191 | }
1192 | ],
1193 | "captures": {
1194 | "1": {
1195 | "name": "punctuation.definition.fenced.markdown"
1196 | },
1197 | "2": {
1198 | "name": "variable.language.fenced.markdown"
1199 | },
1200 | "3": {
1201 | "name": "punctuation.definition.fenced.markdown"
1202 | }
1203 | }
1204 | },
1205 | {
1206 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1207 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1208 | "begin": "(```|~~~|{%\\s*highlight)\\s*(obj(?:ective\\-|)c\\+\\+)\\s*((?:linenos\\s*)?%})?$",
1209 | "patterns": [
1210 | {
1211 | "include": "source.objc++"
1212 | }
1213 | ],
1214 | "captures": {
1215 | "1": {
1216 | "name": "punctuation.definition.fenced.markdown"
1217 | },
1218 | "2": {
1219 | "name": "variable.language.fenced.markdown"
1220 | },
1221 | "3": {
1222 | "name": "punctuation.definition.fenced.markdown"
1223 | }
1224 | }
1225 | },
1226 | {
1227 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1228 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1229 | "begin": "(```|~~~|{%\\s*highlight)\\s*(perl)\\s*((?:linenos\\s*)?%})?$",
1230 | "patterns": [
1231 | {
1232 | "include": "source.perl"
1233 | }
1234 | ],
1235 | "captures": {
1236 | "1": {
1237 | "name": "punctuation.definition.fenced.markdown"
1238 | },
1239 | "2": {
1240 | "name": "variable.language.fenced.markdown"
1241 | },
1242 | "3": {
1243 | "name": "punctuation.definition.fenced.markdown"
1244 | }
1245 | }
1246 | },
1247 | {
1248 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1249 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1250 | "begin": "(```|~~~|{%\\s*highlight)\\s*(php)\\s*((?:linenos\\s*)?%})?$",
1251 | "patterns": [
1252 | {
1253 | "include": "source.php"
1254 | }
1255 | ],
1256 | "captures": {
1257 | "1": {
1258 | "name": "punctuation.definition.fenced.markdown"
1259 | },
1260 | "2": {
1261 | "name": "variable.language.fenced.markdown"
1262 | },
1263 | "3": {
1264 | "name": "punctuation.definition.fenced.markdown"
1265 | }
1266 | }
1267 | },
1268 | {
1269 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1270 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1271 | "begin": "(```|~~~|{%\\s*highlight)\\s*(python)\\s*((?:linenos\\s*)?%})?$",
1272 | "patterns": [
1273 | {
1274 | "include": "source.python"
1275 | }
1276 | ],
1277 | "captures": {
1278 | "1": {
1279 | "name": "punctuation.definition.fenced.markdown"
1280 | },
1281 | "2": {
1282 | "name": "variable.language.fenced.markdown"
1283 | },
1284 | "3": {
1285 | "name": "punctuation.definition.fenced.markdown"
1286 | }
1287 | }
1288 | },
1289 | {
1290 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1291 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1292 | "begin": "(```|~~~)\\s*\\{?\\s*(r)(?:[ \\}].*$|\\}?$)",
1293 | "patterns": [
1294 | {
1295 | "include": "source.r"
1296 | }
1297 | ],
1298 | "captures": {
1299 | "1": {
1300 | "name": "punctuation.definition.fenced.markdown"
1301 | },
1302 | "2": {
1303 | "name": "variable.language.fenced.markdown"
1304 | },
1305 | "3": {
1306 | "name": "punctuation.definition.fenced.markdown"
1307 | }
1308 | }
1309 | },
1310 | {
1311 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1312 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1313 | "begin": "(```|~~~|{%\\s*highlight)\\s*(ruby)\\s*((?:linenos\\s*)?%})?$",
1314 | "patterns": [
1315 | {
1316 | "include": "source.ruby"
1317 | }
1318 | ],
1319 | "captures": {
1320 | "1": {
1321 | "name": "punctuation.definition.fenced.markdown"
1322 | },
1323 | "2": {
1324 | "name": "variable.language.fenced.markdown"
1325 | },
1326 | "3": {
1327 | "name": "punctuation.definition.fenced.markdown"
1328 | }
1329 | }
1330 | },
1331 | {
1332 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1333 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1334 | "begin": "(```|~~~|{%\\s*highlight)\\s*(rust)\\s*((?:linenos\\s*)?%})?$",
1335 | "patterns": [
1336 | {
1337 | "include": "source.rust"
1338 | }
1339 | ],
1340 | "captures": {
1341 | "1": {
1342 | "name": "punctuation.definition.fenced.markdown"
1343 | },
1344 | "2": {
1345 | "name": "variable.language.fenced.markdown"
1346 | },
1347 | "3": {
1348 | "name": "punctuation.definition.fenced.markdown"
1349 | }
1350 | }
1351 | },
1352 | {
1353 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1354 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1355 | "begin": "(```|~~~|{%\\s*highlight)\\s*(sass)\\s*((?:linenos\\s*)?%})?$",
1356 | "patterns": [
1357 | {
1358 | "include": "source.sass"
1359 | }
1360 | ],
1361 | "captures": {
1362 | "1": {
1363 | "name": "punctuation.definition.fenced.markdown"
1364 | },
1365 | "2": {
1366 | "name": "variable.language.fenced.markdown"
1367 | },
1368 | "3": {
1369 | "name": "punctuation.definition.fenced.markdown"
1370 | }
1371 | }
1372 | },
1373 | {
1374 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1375 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1376 | "begin": "(```|~~~|{%\\s*highlight)\\s*(scala)\\s*((?:linenos\\s*)?%})?$",
1377 | "patterns": [
1378 | {
1379 | "include": "source.scala"
1380 | }
1381 | ],
1382 | "captures": {
1383 | "1": {
1384 | "name": "punctuation.definition.fenced.markdown"
1385 | },
1386 | "2": {
1387 | "name": "variable.language.fenced.markdown"
1388 | },
1389 | "3": {
1390 | "name": "punctuation.definition.fenced.markdown"
1391 | }
1392 | }
1393 | },
1394 | {
1395 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1396 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1397 | "begin": "(```|~~~|{%\\s*highlight)\\s*(scss)\\s*((?:linenos\\s*)?%})?$",
1398 | "patterns": [
1399 | {
1400 | "include": "source.scss"
1401 | }
1402 | ],
1403 | "captures": {
1404 | "1": {
1405 | "name": "punctuation.definition.fenced.markdown"
1406 | },
1407 | "2": {
1408 | "name": "variable.language.fenced.markdown"
1409 | },
1410 | "3": {
1411 | "name": "punctuation.definition.fenced.markdown"
1412 | }
1413 | }
1414 | },
1415 | {
1416 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1417 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1418 | "begin": "(```|~~~|{%\\s*highlight)\\s*(sh|shell|bash)\\s*((?:linenos\\s*)?%})?$",
1419 | "patterns": [
1420 | {
1421 | "include": "source.shell"
1422 | }
1423 | ],
1424 | "captures": {
1425 | "1": {
1426 | "name": "punctuation.definition.fenced.markdown"
1427 | },
1428 | "2": {
1429 | "name": "variable.language.fenced.markdown"
1430 | },
1431 | "3": {
1432 | "name": "punctuation.definition.fenced.markdown"
1433 | }
1434 | }
1435 | },
1436 | {
1437 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1438 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1439 | "begin": "(```|~~~|{%\\s*highlight)\\s*(sql|mysql|ddl|dml)\\s*((?:linenos\\s*)?%})?$",
1440 | "patterns": [
1441 | {
1442 | "include": "source.sql"
1443 | }
1444 | ],
1445 | "captures": {
1446 | "1": {
1447 | "name": "punctuation.definition.fenced.markdown"
1448 | },
1449 | "2": {
1450 | "name": "variable.language.fenced.markdown"
1451 | },
1452 | "3": {
1453 | "name": "punctuation.definition.fenced.markdown"
1454 | }
1455 | }
1456 | },
1457 | {
1458 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1459 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1460 | "begin": "(```|~~~|{%\\s*highlight)\\s*(postgresql|postgres|pgsql)\\s*((?:linenos\\s*)?%})?$",
1461 | "patterns": [
1462 | {
1463 | "include": "source.pgsql"
1464 | }
1465 | ],
1466 | "captures": {
1467 | "1": {
1468 | "name": "punctuation.definition.fenced.markdown"
1469 | },
1470 | "2": {
1471 | "name": "variable.language.fenced.markdown"
1472 | },
1473 | "3": {
1474 | "name": "punctuation.definition.fenced.markdown"
1475 | }
1476 | }
1477 | },
1478 | {
1479 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1480 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1481 | "begin": "(```|~~~|{%\\s*highlight)\\s*(styl)\\s*((?:linenos\\s*)?%})?$",
1482 | "patterns": [
1483 | {
1484 | "include": "source.stylus"
1485 | }
1486 | ],
1487 | "captures": {
1488 | "1": {
1489 | "name": "punctuation.definition.fenced.markdown"
1490 | },
1491 | "2": {
1492 | "name": "variable.language.fenced.markdown"
1493 | },
1494 | "3": {
1495 | "name": "punctuation.definition.fenced.markdown"
1496 | }
1497 | }
1498 | },
1499 | {
1500 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1501 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1502 | "begin": "(```|~~~|{%\\s*highlight)\\s*(swig|liquid)\\s*((?:linenos\\s*)?%})?$",
1503 | "patterns": [
1504 | {
1505 | "include": "text.html.swig"
1506 | }
1507 | ],
1508 | "captures": {
1509 | "1": {
1510 | "name": "punctuation.definition.fenced.markdown"
1511 | },
1512 | "2": {
1513 | "name": "variable.language.fenced.markdown"
1514 | },
1515 | "3": {
1516 | "name": "punctuation.definition.fenced.markdown"
1517 | }
1518 | }
1519 | },
1520 | {
1521 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1522 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1523 | "begin": "(```|~~~|{%\\s*highlight)\\s*(xml)\\s*((?:linenos\\s*)?%})?$",
1524 | "patterns": [
1525 | {
1526 | "include": "text.xml"
1527 | }
1528 | ],
1529 | "captures": {
1530 | "1": {
1531 | "name": "punctuation.definition.fenced.markdown"
1532 | },
1533 | "2": {
1534 | "name": "variable.language.fenced.markdown"
1535 | },
1536 | "3": {
1537 | "name": "punctuation.definition.fenced.markdown"
1538 | }
1539 | }
1540 | },
1541 | {
1542 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1543 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1544 | "begin": "(```|~~~|{%\\s*highlight)\\s*(yaml)\\s*((?:linenos\\s*)?%})?$",
1545 | "patterns": [
1546 | {
1547 | "include": "source.yaml"
1548 | }
1549 | ],
1550 | "captures": {
1551 | "1": {
1552 | "name": "punctuation.definition.fenced.markdown"
1553 | },
1554 | "2": {
1555 | "name": "variable.language.fenced.markdown"
1556 | },
1557 | "3": {
1558 | "name": "punctuation.definition.fenced.markdown"
1559 | }
1560 | }
1561 | },
1562 | {
1563 | "name": "markup.raw.block.markdown markup.raw.block.fenced.markdown",
1564 | "end": "(```|~~~|{%\\s*endhighlight\\s*%})\\n",
1565 | "captures": {
1566 | "1": {
1567 | "name": "punctuation.definition.fenced.markdown"
1568 | },
1569 | "2": {
1570 | "name": "variable.language.fenced.markdown"
1571 | },
1572 | "3": {
1573 | "name": "punctuation.definition.fenced.markdown"
1574 | }
1575 | },
1576 | "begin": "(```|~~~|{%\\s*highlight)\\s*(\\w*)\\s*((?:linenos\\s*)?%})?$"
1577 | },
1578 | {
1579 | "name": "markup.list.unnumbered.markdown",
1580 | "end": "^(?=\\S)",
1581 | "begin": "^[ ]{0,3}([*+-])(?=\\s)",
1582 | "patterns": [
1583 | {
1584 | "include": "#list-paragraph"
1585 | }
1586 | ],
1587 | "captures": {
1588 | "1": {
1589 | "name": "punctuation.definition.list_item.markdown"
1590 | }
1591 | }
1592 | },
1593 | {
1594 | "name": "markup.list.numbered.markdown",
1595 | "end": "^(?=\\S)",
1596 | "begin": "^[ ]{0,3}([0-9]+)(\\.)(?=\\s)",
1597 | "patterns": [
1598 | {
1599 | "include": "#list-paragraph"
1600 | }
1601 | ],
1602 | "captures": {
1603 | "1": {
1604 | "name": "punctuation.definition.list_item.markdown punctuation.definition.list_item.number.markdown"
1605 | },
1606 | "2": {
1607 | "name": "punctuation.definition.list_item.markdown"
1608 | }
1609 | }
1610 | },
1611 | {
1612 | "name": "meta.disable-markdown",
1613 | "end": "(?<=^\\1>$\\n)",
1614 | "patterns": [
1615 | {
1616 | "include": "text.html.basic"
1617 | },
1618 | {
1619 | "include": "text.html.handlebars"
1620 | }
1621 | ],
1622 | "comment": "\n Markdown formatting is disabled inside block-level tags.\n ",
1623 | "begin": "^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\\b)(?!.*?\\1>)"
1624 | },
1625 | {
1626 | "name": "meta.disable-markdown",
1627 | "end": "$\\n?",
1628 | "patterns": [
1629 | {
1630 | "include": "text.html.basic"
1631 | },
1632 | {
1633 | "include": "text.html.handlebars"
1634 | }
1635 | ],
1636 | "comment": "Same rule but for one line disables.",
1637 | "begin": "^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\\b)"
1638 | },
1639 | {
1640 | "name": "meta.link.reference.def.markdown",
1641 | "match": "(?x:\n \\s* # Leading whitespace\n (\\[)(.+?)(\\])(:) # Reference name\n [ \\t]* # Optional whitespace\n ()(\\S+?)(>?) # The url\n [ \\t]* # Optional whitespace\n (?:\n ((\\().+?(\\))) # Match title in quotes\u2026\n | ((\").+?(\")) # or in parens.\n )? # Title is optional\n \\s* # Optional whitespace\n $\n )",
1642 | "captures": {
1643 | "4": {
1644 | "name": "punctuation.separator.key-value.markdown"
1645 | },
1646 | "5": {
1647 | "name": "punctuation.definition.link.markdown"
1648 | },
1649 | "6": {
1650 | "name": "markup.underline.link.markdown"
1651 | },
1652 | "7": {
1653 | "name": "punctuation.definition.link.markdown"
1654 | },
1655 | "10": {
1656 | "name": "punctuation.definition.string.end.markdown"
1657 | },
1658 | "1": {
1659 | "name": "punctuation.definition.constant.markdown"
1660 | },
1661 | "2": {
1662 | "name": "constant.other.reference.link.markdown"
1663 | },
1664 | "3": {
1665 | "name": "punctuation.definition.constant.markdown"
1666 | },
1667 | "13": {
1668 | "name": "punctuation.definition.string.end.markdown"
1669 | },
1670 | "8": {
1671 | "name": "string.other.link.description.title.markdown"
1672 | },
1673 | "9": {
1674 | "name": "punctuation.definition.string.begin.markdown"
1675 | },
1676 | "12": {
1677 | "name": "punctuation.definition.string.begin.markdown"
1678 | },
1679 | "11": {
1680 | "name": "string.other.link.description.title.markdown"
1681 | }
1682 | }
1683 | },
1684 | {
1685 | "name": "meta.paragraph.markdown",
1686 | "end": "^(?:\\s*$|(?=[ ]{,3}>.))|(?=[ \\t]*\\n)(?<=^===|^====|=====|^---|^----|-----)[ \\t]*\\n|(?=^#)",
1687 | "patterns": [
1688 | {
1689 | "include": "#inline"
1690 | },
1691 | {
1692 | "include": "text.html.handlebars"
1693 | },
1694 | {
1695 | "name": "markup.heading.1.markdown",
1696 | "match": "^(={3,})(?=[ \\t]*$)",
1697 | "captures": {
1698 | "1": {
1699 | "name": "punctuation.definition.heading.markdown"
1700 | }
1701 | }
1702 | },
1703 | {
1704 | "name": "markup.heading.2.markdown",
1705 | "match": "^(-{3,})(?=[ \\t]*$)",
1706 | "captures": {
1707 | "1": {
1708 | "name": "punctuation.definition.heading.markdown"
1709 | }
1710 | }
1711 | }
1712 | ],
1713 | "begin": "^(?=\\S)(?![=-]{3,}(?=$))"
1714 | }
1715 | ],
1716 | "fileTypes": [
1717 | "mdown",
1718 | "markdown",
1719 | "markdn",
1720 | "md.hbs",
1721 | "md"
1722 | ],
1723 | "keyEquivalent": "^~M"
1724 | }
--------------------------------------------------------------------------------
/Syntaxes/Markdown Extended.YAML-tmLanguage:
--------------------------------------------------------------------------------
1 | # [PackageDev] target_format: plist, ext: tmLanguage
2 | name: Markdown Extended
3 | scopeName: text.html.markdown
4 | fileTypes: [mdown, markdown, markdn, md.hbs, md]
5 | uuid: dd477cf1-34c4-49d2-ba09-f8445676ccd4
6 |
7 | patterns:
8 | - name: markup.raw.yaml.front-matter
9 | begin: (?.
33 | | ([ ]{4}|\t)(?!$)
34 | | [#]{1,6}\s*+
35 | | [ ]{,3}(?[-*_])([ ]{,2}\k){2,}[ \t]*+$
36 | )
37 | end: |-
38 | (?x)^
39 | (?! [ ]{,3}>.
40 | | ([ ]{4}|\t)
41 | | [#]{1,6}\s*+
42 | | [ ]{,3}(?[-*_])([ ]{,2}\k){2,}[ \t]*+$
43 | )
44 | patterns:
45 | - include: '#block_quote'
46 | - include: '#block_raw'
47 | - include: '#heading'
48 | - include: '#separator'
49 |
50 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
51 | begin: (```|~~~|{%\s*highlight)\s*(c)\s*((?:linenos\s*)?%})?$
52 | end: (```|~~~|{%\s*endhighlight\s*%})\n
53 | captures:
54 | '1': {name: punctuation.definition.fenced.markdown}
55 | '2': {name: variable.language.fenced.markdown}
56 | '3': {name: punctuation.definition.fenced.markdown}
57 | patterns:
58 | - include: source.c
59 |
60 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
61 | begin: (```|~~~|{%\s*highlight)\s*(cpp)\s*((?:linenos\s*)?%})?$
62 | end: (```|~~~|{%\s*endhighlight\s*%})\n
63 | captures:
64 | '1': {name: punctuation.definition.fenced.markdown}
65 | '2': {name: variable.language.fenced.markdown}
66 | '3': {name: punctuation.definition.fenced.markdown}
67 | patterns:
68 | - include: source.c++
69 |
70 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
71 | begin: (```|~~~|{%\s*highlight)\s*(coffee|coffeescript)\s*((?:linenos\s*)?%})?$
72 | end: (```|~~~|{%\s*endhighlight\s*%})\n
73 | captures:
74 | '1': {name: punctuation.definition.fenced.markdown}
75 | '2': {name: variable.language.fenced.markdown}
76 | '3': {name: punctuation.definition.fenced.markdown}
77 | patterns:
78 | - include: source.coffee
79 |
80 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
81 | begin: (```|~~~|{%\s*highlight)\s*(jade)\s*((?:linenos\s*)?%})?$
82 | end: (```|~~~|{%\s*endhighlight\s*%})\n
83 | captures:
84 | '1': {name: punctuation.definition.fenced.markdown}
85 | '2': {name: variable.language.fenced.markdown}
86 | '3': {name: punctuation.definition.fenced.markdown}
87 | patterns:
88 | - include: source.jade
89 |
90 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
91 | begin: (```|~~~|{%\s*highlight)\s*(css)\s*((?:linenos\s*)?%})?$
92 | end: (```|~~~|{%\s*endhighlight\s*%})\n
93 | captures:
94 | '1': {name: punctuation.definition.fenced.markdown}
95 | '2': {name: variable.language.fenced.markdown}
96 | '3': {name: punctuation.definition.fenced.markdown}
97 | patterns:
98 | - include: source.css
99 |
100 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
101 | begin: (```|~~~|{%\s*highlight)\s*(csharp)\s*((?:linenos\s*)?%})?$
102 | end: (```|~~~|{%\s*endhighlight\s*%})\n
103 | captures:
104 | '1': {name: punctuation.definition.fenced.markdown}
105 | '2': {name: variable.language.fenced.markdown}
106 | '3': {name: punctuation.definition.fenced.markdown}
107 | patterns:
108 | - include: source.cs
109 |
110 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
111 | begin: (```|~~~|{%\s*highlight)\s*(ejs|underscore|lodash)\s*((?:linenos\s*)?%})?$
112 | end: (```|~~~|{%\s*endhighlight\s*%})\n
113 | captures:
114 | '1': {name: punctuation.definition.fenced.markdown}
115 | '2': {name: variable.language.fenced.markdown}
116 | '3': {name: punctuation.definition.fenced.markdown}
117 | patterns:
118 | - include: source.ejs
119 |
120 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
121 | begin: (```|~~~|{%\s*highlight)\s*(diff)\s*((?:linenos\s*)?%})?$
122 | end: (```|~~~|{%\s*endhighlight\s*%})\n
123 | captures:
124 | '1': {name: punctuation.definition.fenced.markdown}
125 | '2': {name: variable.language.fenced.markdown}
126 | '3': {name: punctuation.definition.fenced.markdown}
127 | patterns:
128 | - include: source.diff
129 |
130 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
131 | begin: (```|~~~|{%\s*highlight)\s*(go|golang)\s*((?:linenos\s*)?%})?$
132 | end: (```|~~~|{%\s*endhighlight\s*%})\n
133 | captures:
134 | '1': {name: punctuation.definition.fenced.markdown}
135 | '2': {name: variable.language.fenced.markdown}
136 | '3': {name: punctuation.definition.fenced.markdown}
137 | patterns:
138 | - include: source.go
139 |
140 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
141 | begin: (```|~~~|{%\s*highlight)\s*(graphql)\s*((?:linenos\s*)?%})?$
142 | end: (```|~~~|{%\s*endhighlight\s*%})\n
143 | captures:
144 | '1': {name: punctuation.definition.fenced.markdown}
145 | '2': {name: variable.language.fenced.markdown}
146 | '3': {name: punctuation.definition.fenced.markdown}
147 | patterns:
148 | - include: source.graphql
149 |
150 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
151 | begin: (```|~~~|{%\s*highlight)\s*(hbs|handlebars|html|html5)\s*((?:linenos\s*)?%})?$
152 | end: (```|~~~|{%\s*endhighlight\s*%})\n
153 | captures:
154 | '1': {name: punctuation.definition.fenced.markdown}
155 | '2': {name: variable.language.fenced.markdown}
156 | '3': {name: punctuation.definition.fenced.markdown}
157 | patterns:
158 | - include: text.html.basic
159 | - include: text.html.handlebars
160 |
161 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
162 | begin: (```|~~~|{%\s*highlight)\s*(java)\s*((?:linenos\s*)?%})?$
163 | end: (```|~~~|{%\s*endhighlight\s*%})\n
164 | captures:
165 | '1': {name: punctuation.definition.fenced.markdown}
166 | '2': {name: variable.language.fenced.markdown}
167 | '3': {name: punctuation.definition.fenced.markdown}
168 | patterns:
169 | - include: source.java
170 |
171 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
172 | begin: (```|~~~|{%\s*highlight)\s*(javascript|js)\s*((?:linenos\s*)?%})?$
173 | end: (```|~~~|{%\s*endhighlight\s*%})\n
174 | captures:
175 | '1': {name: punctuation.definition.fenced.markdown}
176 | '2': {name: variable.language.fenced.markdown}
177 | '3': {name: punctuation.definition.fenced.markdown}
178 | patterns:
179 | - include: source.js
180 |
181 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
182 | begin: (```|~~~|{%\s*highlight)\s*(json)\s*((?:linenos\s*)?%})?$
183 | end: (```|~~~|{%\s*endhighlight\s*%})\n
184 | captures:
185 | '1': {name: punctuation.definition.fenced.markdown}
186 | '2': {name: variable.language.fenced.markdown}
187 | '3': {name: punctuation.definition.fenced.markdown}
188 | patterns:
189 | - include: source.json
190 |
191 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
192 | begin: (```|{%\s*highlight)\s*(julia|jl)\s*((?:linenos\s*)?%})?$
193 | end: (```|{%\s*endhighlight\s*%})\n
194 | captures:
195 | '1': {name: punctuation.definition.fenced.markdown}
196 | '2': {name: variable.language.fenced.markdown}
197 | '3': {name: punctuation.definition.fenced.markdown}
198 | patterns:
199 | - include: source.julia
200 |
201 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
202 | begin: (```|{%\s*highlight)\s*(less)\s*((?:linenos\s*)?%})?$
203 | end: (```|{%\s*endhighlight\s*%})\n
204 | captures:
205 | '1': {name: punctuation.definition.fenced.markdown}
206 | '2': {name: variable.language.fenced.markdown}
207 | '3': {name: punctuation.definition.fenced.markdown}
208 | patterns:
209 | - include: source.css.less
210 |
211 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
212 | begin: (```|~~~|{%\s*highlight)\s*(ls|livescript|LiveScript)\s*((?:linenos\s*)?%})?$
213 | end: (```|~~~|{%\s*endhighlight\s*%})\n
214 | captures:
215 | '1': {name: punctuation.definition.fenced.markdown}
216 | '2': {name: variable.language.fenced.markdown}
217 | '3': {name: punctuation.definition.fenced.markdown}
218 | patterns:
219 | - include: source.livescript
220 |
221 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
222 | begin: (```|~~~|{%\s*highlight)\s*(lua)\s*((?:linenos\s*)?%})?$
223 | end: (```|~~~|{%\s*endhighlight\s*%})\n
224 | captures:
225 | '1': {name: punctuation.definition.fenced.markdown}
226 | '2': {name: variable.language.fenced.markdown}
227 | '3': {name: punctuation.definition.fenced.markdown}
228 | patterns:
229 | - include: source.lua
230 |
231 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
232 | begin: (```|~~~|{%\s*highlight)\s*(md|markdown)\s*((?:linenos\s*)?%})?$
233 | end: (```|~~~|{%\s*endhighlight\s*%})\n
234 | captures:
235 | '1': {name: punctuation.definition.fenced.markdown}
236 | '2': {name: variable.language.fenced.markdown}
237 | '3': {name: punctuation.definition.fenced.markdown}
238 | patterns:
239 | - include: text.html.markdown
240 |
241 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
242 | begin: (```|~~~|{%\s*highlight)\s*(swift)\s*((?:linenos\s*)?%})?$
243 | end: (```|~~~|{%\s*endhighlight\s*%})\n
244 | captures:
245 | '1': {name: punctuation.definition.fenced.markdown}
246 | '2': {name: variable.language.fenced.markdown}
247 | '3': {name: punctuation.definition.fenced.markdown}
248 | patterns:
249 | - include: source.swift
250 |
251 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
252 | begin: (```|~~~|{%\s*highlight)\s*(obj(?:ective\-|)c)\s*((?:linenos\s*)?%})?$
253 | end: (```|~~~|{%\s*endhighlight\s*%})\n
254 | captures:
255 | '1': {name: punctuation.definition.fenced.markdown}
256 | '2': {name: variable.language.fenced.markdown}
257 | '3': {name: punctuation.definition.fenced.markdown}
258 | patterns:
259 | - include: source.objc
260 |
261 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
262 | begin: (```|~~~|{%\s*highlight)\s*(obj(?:ective\-|)c\+\+)\s*((?:linenos\s*)?%})?$
263 | end: (```|~~~|{%\s*endhighlight\s*%})\n
264 | captures:
265 | '1': {name: punctuation.definition.fenced.markdown}
266 | '2': {name: variable.language.fenced.markdown}
267 | '3': {name: punctuation.definition.fenced.markdown}
268 | patterns:
269 | - include: source.objc++
270 |
271 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
272 | begin: (```|~~~|{%\s*highlight)\s*(perl)\s*((?:linenos\s*)?%})?$
273 | end: (```|~~~|{%\s*endhighlight\s*%})\n
274 | captures:
275 | '1': {name: punctuation.definition.fenced.markdown}
276 | '2': {name: variable.language.fenced.markdown}
277 | '3': {name: punctuation.definition.fenced.markdown}
278 | patterns:
279 | - include: source.perl
280 |
281 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
282 | begin: (```|~~~|{%\s*highlight)\s*(php)\s*((?:linenos\s*)?%})?$
283 | end: (```|~~~|{%\s*endhighlight\s*%})\n
284 | captures:
285 | '1': {name: punctuation.definition.fenced.markdown}
286 | '2': {name: variable.language.fenced.markdown}
287 | '3': {name: punctuation.definition.fenced.markdown}
288 | patterns:
289 | - include: source.php
290 |
291 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
292 | begin: (```|~~~|{%\s*highlight)\s*(python)\s*((?:linenos\s*)?%})?$
293 | end: (```|~~~|{%\s*endhighlight\s*%})\n
294 | captures:
295 | '1': {name: punctuation.definition.fenced.markdown}
296 | '2': {name: variable.language.fenced.markdown}
297 | '3': {name: punctuation.definition.fenced.markdown}
298 | patterns:
299 | - include: source.python
300 |
301 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
302 | begin: (```|~~~)\s*\{?\s*(r)(?:[ \}].*$|\}?$)
303 | end: (```|~~~|{%\s*endhighlight\s*%})\n
304 | captures:
305 | '1': {name: punctuation.definition.fenced.markdown}
306 | '2': {name: variable.language.fenced.markdown}
307 | '3': {name: punctuation.definition.fenced.markdown}
308 | patterns:
309 | - include: source.r
310 |
311 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
312 | begin: (```|~~~|{%\s*highlight)\s*(ruby)\s*((?:linenos\s*)?%})?$
313 | end: (```|~~~|{%\s*endhighlight\s*%})\n
314 | captures:
315 | '1': {name: punctuation.definition.fenced.markdown}
316 | '2': {name: variable.language.fenced.markdown}
317 | '3': {name: punctuation.definition.fenced.markdown}
318 | patterns:
319 | - include: source.ruby
320 |
321 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
322 | begin: (```|~~~|{%\s*highlight)\s*(rust)\s*((?:linenos\s*)?%})?$
323 | end: (```|~~~|{%\s*endhighlight\s*%})\n
324 | captures:
325 | '1': {name: punctuation.definition.fenced.markdown}
326 | '2': {name: variable.language.fenced.markdown}
327 | '3': {name: punctuation.definition.fenced.markdown}
328 | patterns:
329 | - include: source.rust
330 |
331 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
332 | begin: (```|~~~|{%\s*highlight)\s*(sass)\s*((?:linenos\s*)?%})?$
333 | end: (```|~~~|{%\s*endhighlight\s*%})\n
334 | captures:
335 | '1': {name: punctuation.definition.fenced.markdown}
336 | '2': {name: variable.language.fenced.markdown}
337 | '3': {name: punctuation.definition.fenced.markdown}
338 | patterns:
339 | - include: source.sass
340 |
341 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
342 | begin: (```|~~~|{%\s*highlight)\s*(scala)\s*((?:linenos\s*)?%})?$
343 | end: (```|~~~|{%\s*endhighlight\s*%})\n
344 | captures:
345 | '1': {name: punctuation.definition.fenced.markdown}
346 | '2': {name: variable.language.fenced.markdown}
347 | '3': {name: punctuation.definition.fenced.markdown}
348 | patterns:
349 | - include: source.scala
350 |
351 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
352 | begin: (```|~~~|{%\s*highlight)\s*(scss)\s*((?:linenos\s*)?%})?$
353 | end: (```|~~~|{%\s*endhighlight\s*%})\n
354 | captures:
355 | '1': {name: punctuation.definition.fenced.markdown}
356 | '2': {name: variable.language.fenced.markdown}
357 | '3': {name: punctuation.definition.fenced.markdown}
358 | patterns:
359 | - include: source.scss
360 |
361 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
362 | begin: (```|~~~|{%\s*highlight)\s*(sh|shell|bash)\s*((?:linenos\s*)?%})?$
363 | end: (```|~~~|{%\s*endhighlight\s*%})\n
364 | captures:
365 | '1': {name: punctuation.definition.fenced.markdown}
366 | '2': {name: variable.language.fenced.markdown}
367 | '3': {name: punctuation.definition.fenced.markdown}
368 | patterns:
369 | - include: source.shell
370 |
371 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
372 | begin: (```|~~~|{%\s*highlight)\s*(sql|mysql|ddl|dml)\s*((?:linenos\s*)?%})?$
373 | end: (```|~~~|{%\s*endhighlight\s*%})\n
374 | captures:
375 | '1': {name: punctuation.definition.fenced.markdown}
376 | '2': {name: variable.language.fenced.markdown}
377 | '3': {name: punctuation.definition.fenced.markdown}
378 | patterns:
379 | - include: source.sql
380 |
381 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
382 | begin: (```|~~~|{%\s*highlight)\s*(postgresql|postgres|pgsql)\s*((?:linenos\s*)?%})?$
383 | end: (```|~~~|{%\s*endhighlight\s*%})\n
384 | captures:
385 | '1': {name: punctuation.definition.fenced.markdown}
386 | '2': {name: variable.language.fenced.markdown}
387 | '3': {name: punctuation.definition.fenced.markdown}
388 | patterns:
389 | - include: source.pgsql
390 |
391 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
392 | begin: (```|~~~|{%\s*highlight)\s*(styl)\s*((?:linenos\s*)?%})?$
393 | end: (```|~~~|{%\s*endhighlight\s*%})\n
394 | captures:
395 | '1': {name: punctuation.definition.fenced.markdown}
396 | '2': {name: variable.language.fenced.markdown}
397 | '3': {name: punctuation.definition.fenced.markdown}
398 | patterns:
399 | - include: source.stylus
400 |
401 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
402 | begin: (```|~~~|{%\s*highlight)\s*(swig|liquid)\s*((?:linenos\s*)?%})?$
403 | end: (```|~~~|{%\s*endhighlight\s*%})\n
404 | captures:
405 | '1': {name: punctuation.definition.fenced.markdown}
406 | '2': {name: variable.language.fenced.markdown}
407 | '3': {name: punctuation.definition.fenced.markdown}
408 | patterns:
409 | - include: text.html.swig
410 |
411 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
412 | begin: (```|~~~|{%\s*highlight)\s*(xml)\s*((?:linenos\s*)?%})?$
413 | end: (```|~~~|{%\s*endhighlight\s*%})\n
414 | captures:
415 | '1': {name: punctuation.definition.fenced.markdown}
416 | '2': {name: variable.language.fenced.markdown}
417 | '3': {name: punctuation.definition.fenced.markdown}
418 | patterns:
419 | - include: text.xml
420 |
421 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
422 | begin: (```|~~~|{%\s*highlight)\s*(yaml)\s*((?:linenos\s*)?%})?$
423 | end: (```|~~~|{%\s*endhighlight\s*%})\n
424 | captures:
425 | '1': {name: punctuation.definition.fenced.markdown}
426 | '2': {name: variable.language.fenced.markdown}
427 | '3': {name: punctuation.definition.fenced.markdown}
428 | patterns:
429 | - include: source.yaml
430 |
431 | - name: markup.raw.block.markdown markup.raw.block.fenced.markdown
432 | begin: (```|~~~|{%\s*highlight)\s*(\w*)\s*((?:linenos\s*)?%})?$
433 | end: (```|~~~|{%\s*endhighlight\s*%})\n
434 | captures:
435 | '1': {name: punctuation.definition.fenced.markdown}
436 | '2': {name: variable.language.fenced.markdown}
437 | '3': {name: punctuation.definition.fenced.markdown}
438 |
439 | - name: markup.list.unnumbered.markdown
440 | begin: ^[ ]{0,3}([*+-])(?=\s)
441 | end: ^(?=\S)
442 | captures:
443 | '1': {name: punctuation.definition.list_item.markdown}
444 | patterns:
445 | - include: '#list-paragraph'
446 |
447 | - name: markup.list.numbered.markdown
448 | begin: ^[ ]{0,3}([0-9]+)(\.)(?=\s)
449 | end: ^(?=\S)
450 | captures:
451 | '1': {name: punctuation.definition.list_item.markdown punctuation.definition.list_item.number.markdown}
452 | '2': {name: punctuation.definition.list_item.markdown}
453 | patterns:
454 | - include: '#list-paragraph'
455 |
456 | - comment: "\n Markdown formatting is disabled inside block-level tags.\n \
457 | \ "
458 | name: meta.disable-markdown
459 | begin: ^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)(?!.*?\1>)
460 | end: (?<=^\1>$\n)
461 | patterns:
462 | - include: text.html.basic
463 | - include: text.html.handlebars
464 |
465 | - comment: Same rule but for one line disables.
466 | name: meta.disable-markdown
467 | begin: ^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)
468 | end: $\n?
469 | patterns:
470 | - include: text.html.basic
471 | - include: text.html.handlebars
472 |
473 | - name: meta.link.reference.def.markdown
474 | match: "(?x:\n \\s* # Leading whitespace\n (\\[)(.+?)(\\\
475 | ])(:) # Reference name\n [ \\t]* # Optional whitespace\n \
476 | \ ()(\\S+?)(>?) # The url\n [ \\t]* # Optional whitespace\n\
477 | \ (?:\n ((\\().+?(\\))) # Match title in quotes\u2026\n \
478 | \ | ((\").+?(\")) # or in parens.\n )? # Title is optional\n\
479 | \ \\s* # Optional whitespace\n $\n )"
480 | captures:
481 | '1': {name: punctuation.definition.constant.markdown}
482 | '2': {name: constant.other.reference.link.markdown}
483 | '3': {name: punctuation.definition.constant.markdown}
484 | '4': {name: punctuation.separator.key-value.markdown}
485 | '5': {name: punctuation.definition.link.markdown}
486 | '6': {name: markup.underline.link.markdown}
487 | '7': {name: punctuation.definition.link.markdown}
488 | '8': {name: string.other.link.description.title.markdown}
489 | '9': {name: punctuation.definition.string.begin.markdown}
490 | '10': {name: punctuation.definition.string.end.markdown}
491 | '11': {name: string.other.link.description.title.markdown}
492 | '12': {name: punctuation.definition.string.begin.markdown}
493 | '13': {name: punctuation.definition.string.end.markdown}
494 |
495 | - name: meta.paragraph.markdown
496 | begin: ^(?=\S)(?![=-]{3,}(?=$))
497 | end: ^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[
498 | \t]*\n|(?=^#)
499 | patterns:
500 | - include: '#inline'
501 | - include: text.html.handlebars
502 | - name: markup.heading.1.markdown
503 | match: ^(={3,})(?=[ \t]*$)
504 | captures:
505 | '1': {name: punctuation.definition.heading.markdown}
506 | - name: markup.heading.2.markdown
507 | match: ^(-{3,})(?=[ \t]*$)
508 | captures:
509 | '1': {name: punctuation.definition.heading.markdown}
510 |
511 | repository:
512 | ampersand:
513 | comment: "\n Markdown will convert this for us. We match it so that the\n\
514 | \ HTML grammar will not mark it up as invalid.\n "
515 | name: meta.other.valid-ampersand.markdown
516 | match: '&(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)'
517 |
518 | block_quote:
519 | comment: "\n We terminate the block quote when seeing an empty line, a\n\
520 | \ separator or a line with leading > characters. The latter is\n \
521 | \ to \u201Creset\u201D the quote level for quoted lines.\n "
522 | name: markup.quote.markdown
523 | begin: \G[ ]{,3}(>)(?!$)[ ]?
524 | beginCaptures:
525 | '1': {name: punctuation.definition.blockquote.markdown}
526 | end: |-
527 | (?x)^
528 | (?= \s*$
529 | | [ ]{,3}(?[-*_])([ ]{,2}\k){2,}[ \t]*+$
530 | | [ ]{,3}>.
531 | )
532 | patterns:
533 | - begin: |-
534 | (?x)\G
535 | (?= [ ]{,3}>.
536 | )
537 | end: ^
538 | patterns:
539 | - include: '#block_quote'
540 | - begin: |-
541 | (?x)\G
542 | (?= ([ ]{4}|\t)
543 | | [#]{1,6}\s*+
544 | | [ ]{,3}(?[-*_])([ ]{,2}\k){2,}[ \t]*+$
545 | )
546 | end: ^
547 | patterns:
548 | - include: '#block_raw'
549 | - include: '#heading'
550 | - include: '#separator'
551 | applyEndPatternLast: 1
552 | - begin: |-
553 | (?x)\G
554 | (?! $
555 | | [ ]{,3}>.
556 | | ([ ]{4}|\t)
557 | | [#]{1,6}\s*+
558 | | [ ]{,3}(?[-*_])([ ]{,2}\k){2,}[ \t]*+$
559 | )
560 | end: $|(?<=\n)
561 | patterns:
562 | - include: '#inline'
563 |
564 | block_raw:
565 | name: markup.raw.block.markdown
566 | match: \G([ ]{4}|\t).*$\n?
567 |
568 | bold:
569 | name: markup.bold.markdown
570 | begin: |-
571 | (?x)
572 | (\*\*|__)(?=\S) # Open
573 | (?=
574 | (
575 | <[^>]*+> # HTML tags
576 | | (?`+)([^`]|(?!(?(?!`))`)*+\k
577 | # Raw
578 | | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes
579 | | \[
580 | (
581 | (? # Named group
582 | [^\[\]\\] # Match most chars
583 | | \\. # Escaped chars
584 | | \[ \g*+ \] # Nested brackets
585 | )*+
586 | \]
587 | (
588 | ( # Reference Link
589 | [ ]? # Optional space
590 | \[[^\]]*+\] # Ref name
591 | )
592 | | ( # Inline Link
593 | \( # Opening paren
594 | [ \t]*+ # Optional whtiespace
595 | (.*?)>? # URL
596 | [ \t]*+ # Optional whtiespace
597 | ( # Optional Title
598 | (?['"])
599 | (.*?)
600 | \k
601 | )?
602 | \)
603 | )
604 | )
605 | )
606 | | (?!(?<=\S)\1). # Everything besides
607 | # style closer
608 | )++
609 | (?<=\S)\1 # Close
610 | )
611 | end: (?<=\S)(\1)
612 | captures:
613 | '1': {name: punctuation.definition.bold.markdown}
614 | patterns:
615 | - begin: (?=<[^>]*?>)
616 | end: (?<=>)
617 | patterns:
618 | - include: text.html.handlebars
619 | applyEndPatternLast: 1
620 | - include: '#escape'
621 | - include: '#ampersand'
622 | - include: '#bracket'
623 | - include: '#raw'
624 | - include: '#italic'
625 | - include: '#image-inline'
626 | - include: '#link-inline'
627 | - include: '#link-inet'
628 | - include: '#link-email'
629 | - include: '#image-ref'
630 | - include: '#link-ref-literal'
631 | - include: '#link-ref'
632 |
633 | bracket:
634 | comment: "\n Markdown will convert this for us. We match it so that the\n\
635 | \ HTML grammar will not mark it up as invalid.\n "
636 | name: meta.other.valid-bracket.markdown
637 | match: <(?![a-z/?\$!])
638 |
639 | escape:
640 | name: constant.character.escape.markdown
641 | match: \\[-`*_#+.!(){}\[\]\\>]
642 |
643 | heading:
644 | name: markup.heading.markdown
645 | contentName: entity.name.section.markdown
646 | begin: \G(#{1,6})(?!#)\s*(?=\S)
647 | end: \s*(#*)$\n?
648 | captures:
649 | '1': {name: punctuation.definition.heading.markdown}
650 | patterns:
651 | - include: '#inline'
652 |
653 | image-inline:
654 | name: meta.image.inline.markdown
655 | match: "(?x:\n \\! # Images start with !\n (\\[)((?[^\\\
656 | [\\]\\\\]|\\\\.|\\[\\g*+\\])*+)(\\])\n # Match\
657 | \ the link text.\n ([ ])? # Space not allowed\n (\\\
658 | () # Opening paren for url\n ()(\\S+?)(>?) # The\
659 | \ url\n [ \\t]* # Optional whitespace\n (?:\n \
660 | \ ((\\().+?(\\))) # Match title in parens\u2026\n | ((\"\
661 | ).+?(\")) # or in quotes.\n )? # Title is optional\n \
662 | \ \\s* # Optional whitespace\n (\\))\n )"
663 | captures:
664 | '1': {name: punctuation.definition.string.begin.markdown}
665 | '2': {name: string.other.link.description.markdown}
666 | '4': {name: punctuation.definition.string.end.markdown}
667 | '5': {name: invalid.illegal.whitespace.markdown}
668 | '6': {name: punctuation.definition.metadata.markdown}
669 | '7': {name: punctuation.definition.link.markdown}
670 | '8': {name: markup.underline.link.image.markdown}
671 | '9': {name: punctuation.definition.link.markdown}
672 | '10': {name: string.other.link.description.title.markdown}
673 | '11': {name: punctuation.definition.string.markdown}
674 | '12': {name: punctuation.definition.string.markdown}
675 | '13': {name: string.other.link.description.title.markdown}
676 | '14': {name: punctuation.definition.string.markdown}
677 | '15': {name: punctuation.definition.string.markdown}
678 | '16': {name: punctuation.definition.metadata.markdown}
679 |
680 | image-ref:
681 | name: meta.image.reference.markdown
682 | match: \!(\[)((?[^\[\]\\]|\\.|\[\g*+\])*+)(\])[ ]?(\[)(.*?)(\])
683 | captures:
684 | '1': {name: punctuation.definition.string.begin.markdown}
685 | '2': {name: string.other.link.description.markdown}
686 | '4': {name: punctuation.definition.string.begin.markdown}
687 | '5': {name: punctuation.definition.constant.markdown}
688 | '6': {name: constant.other.reference.link.markdown}
689 | '7': {name: punctuation.definition.constant.markdown}
690 |
691 | inline:
692 | patterns:
693 | - include: '#escape'
694 | - include: '#ampersand'
695 | - include: '#bracket'
696 | - include: '#raw'
697 | - include: '#bold'
698 | - include: '#italic'
699 | - include: '#line-break'
700 | - include: '#image-inline'
701 | - include: '#link-inline'
702 | - include: '#link-inet'
703 | - include: '#link-email'
704 | - include: '#image-ref'
705 | - include: '#link-ref-literal'
706 | - include: '#link-ref'
707 |
708 | italic:
709 | name: markup.italic.markdown
710 | begin: |-
711 | (?x)
712 | (\*|_)(?=\S) # Open
713 | (?=
714 | (
715 | <[^>]*+> # HTML tags
716 | | (?`+)([^`]|(?!(?(?!`))`)*+\k
717 | # Raw
718 | | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes
719 | | \[
720 | (
721 | (? # Named group
722 | [^\[\]\\] # Match most chars
723 | | \\. # Escaped chars
724 | | \[ \g*+ \] # Nested brackets
725 | )*+
726 | \]
727 | (
728 | ( # Reference Link
729 | [ ]? # Optional space
730 | \[[^\]]*+\] # Ref name
731 | )
732 | | ( # Inline Link
733 | \( # Opening paren
734 | [ \t]*+ # Optional whtiespace
735 | (.*?)>? # URL
736 | [ \t]*+ # Optional whtiespace
737 | ( # Optional Title
738 | (?['"])
739 | (.*?)
740 | \k
741 | )?
742 | \)
743 | )
744 | )
745 | )
746 | | \1\1 # Must be bold closer
747 | | (?!(?<=\S)\1). # Everything besides
748 | # style closer
749 | )++
750 | (?<=\S)\1 # Close
751 | )
752 | end: (?<=\S)(\1)((?!\1)|(?=\1\1))
753 | captures:
754 | '1': {name: punctuation.definition.italic.markdown}
755 | patterns:
756 | - begin: (?=<[^>]*?>)
757 | end: (?<=>)
758 | patterns:
759 | - include: text.html.handlebars
760 | applyEndPatternLast: 1
761 | - include: '#escape'
762 | - include: '#ampersand'
763 | - include: '#bracket'
764 | - include: '#raw'
765 | - include: '#bold'
766 | - include: '#image-inline'
767 | - include: '#link-inline'
768 | - include: '#link-inet'
769 | - include: '#link-email'
770 | - include: '#image-ref'
771 | - include: '#link-ref-literal'
772 | - include: '#link-ref'
773 |
774 | line-break:
775 | name: meta.dummy.line-break
776 | match: ' {2,}$'
777 |
778 | link-email:
779 | name: meta.link.email.lt-gt.markdown
780 | match: (<)((?:mailto:)?[-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(>)
781 | captures:
782 | '1': {name: punctuation.definition.link.markdown}
783 | '2': {name: markup.underline.link.markdown}
784 | '4': {name: punctuation.definition.link.markdown}
785 |
786 | link-inet:
787 | name: meta.link.inet.markdown
788 | match: (<)((?:https?|ftp)://.*?)(>)
789 | captures:
790 | '1': {name: punctuation.definition.link.markdown}
791 | '2': {name: markup.underline.link.markdown}
792 | '3': {name: punctuation.definition.link.markdown}
793 |
794 | link-inline:
795 | name: meta.link.inline.markdown
796 | match: "(?x:\n (\\[)((?[^\\[\\]\\\\]|\\\\.|\\[\\g*+\\])*+)(\\\
797 | ])\n # Match the link text.\n ([ ])? \
798 | \ # Space not allowed\n (\\() # Opening paren for url\n \
799 | \ ()(.*?)(>?) # The url\n [ \\t]* # Optional\
800 | \ whitespace\n (?:\n ((\\().+?(\\))) # Match title in\
801 | \ parens\u2026\n | ((\").+?(\")) # or in quotes.\n )?\
802 | \ # Title is optional\n \\s* # Optional whitespace\n\
803 | \ (\\))\n )"
804 | captures:
805 | '1': {name: punctuation.definition.string.begin.markdown}
806 | '2': {name: string.other.link.title.markdown}
807 | '4': {name: punctuation.definition.string.end.markdown}
808 | '5': {name: invalid.illegal.whitespace.markdown}
809 | '6': {name: punctuation.definition.metadata.markdown}
810 | '7': {name: punctuation.definition.link.markdown}
811 | '8': {name: markup.underline.link.markdown}
812 | '9': {name: punctuation.definition.link.markdown}
813 | '10': {name: string.other.link.description.title.markdown}
814 | '11': {name: punctuation.definition.string.begin.markdown}
815 | '12': {name: punctuation.definition.string.end.markdown}
816 | '13': {name: string.other.link.description.title.markdown}
817 | '14': {name: punctuation.definition.string.begin.markdown}
818 | '15': {name: punctuation.definition.string.end.markdown}
819 | '16': {name: punctuation.definition.metadata.markdown}
820 |
821 | link-ref:
822 | name: meta.link.reference.markdown
823 | match: (\[)((?[^\[\]\\]|\\.|\[\g*+\])*+)(\])[ ]?(\[)([^\]]*+)(\])
824 | captures:
825 | '1': {name: punctuation.definition.string.begin.markdown}
826 | '2': {name: string.other.link.title.markdown}
827 | '4': {name: punctuation.definition.string.end.markdown}
828 | '5': {name: punctuation.definition.constant.begin.markdown}
829 | '6': {name: constant.other.reference.link.markdown}
830 | '7': {name: punctuation.definition.constant.end.markdown}
831 |
832 | link-ref-literal:
833 | name: meta.link.reference.literal.markdown
834 | match: (\[)((?[^\[\]\\]|\\.|\[\g*+\])*+)(\])[ ]?(\[)(\])
835 | captures:
836 | '1': {name: punctuation.definition.string.begin.markdown}
837 | '2': {name: string.other.link.title.markdown}
838 | '4': {name: punctuation.definition.string.end.markdown}
839 | '5': {name: punctuation.definition.constant.begin.markdown}
840 | '6': {name: punctuation.definition.constant.end.markdown}
841 |
842 | list-paragraph:
843 | patterns:
844 | - name: meta.paragraph.list.markdown
845 | begin: \G\s+(?=\S)
846 | end: ^\s*$
847 | patterns:
848 | - include: '#inline'
849 |
850 | raw:
851 | name: markup.raw.inline.markdown
852 | match: (`+)([^`]|(?!(?
863 | |)
864 | |\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/)))
865 | )
866 | foldingStopMarker: |-
867 | (?x)
868 | ((?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)>
869 | |^\s*-->
870 | |(^|\s)\}
871 | )
872 | keyEquivalent: ^~M
873 |
--------------------------------------------------------------------------------
/Syntaxes/Markdown Extended.sublime-syntax:
--------------------------------------------------------------------------------
1 | %YAML 1.2
2 | ---
3 | # http://www.sublimetext.com/docs/3/syntax.html
4 | name: Markdown Extended
5 | file_extensions:
6 | - mdown
7 | - markdown
8 | - markdn
9 | - md.hbs
10 | - md
11 | scope: text.html.markdown
12 | contexts:
13 | main:
14 | - match: (?=(?.
49 | | ([ ]{4}|\t)(?!$)
50 | | [#]{1,6}\s*+
51 | | [ ]{,3}(?[-*_])([ ]{,2}\k){2,}[ \t]*+$
52 | )
53 | comment: |
54 | We could also use an empty end match and set
55 | applyEndPatternLast, but then we must be sure that the begin
56 | pattern will only match stuff matched by the sub-patterns.
57 | push:
58 | - meta_scope: meta.block-level.markdown
59 | - match: |-
60 | (?x)^
61 | (?! [ ]{,3}>.
62 | | ([ ]{4}|\t)
63 | | [#]{1,6}\s*+
64 | | [ ]{,3}(?[-*_])([ ]{,2}\k){2,}[ \t]*+$
65 | )
66 | pop: true
67 | - include: block_quote
68 | - include: block_raw
69 | - include: heading
70 | - include: separator
71 | - match: '(```|~~~|{%\s*highlight)\s*(c)\s*((?:linenos\s*)?%})?$'
72 | captures:
73 | 1: punctuation.definition.fenced.markdown
74 | 2: variable.language.fenced.markdown
75 | 3: punctuation.definition.fenced.markdown
76 | push:
77 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
78 | - meta_content_scope: source.c
79 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
80 | captures:
81 | 1: punctuation.definition.fenced.markdown
82 | 2: variable.language.fenced.markdown
83 | 3: punctuation.definition.fenced.markdown
84 | pop: true
85 | - include: scope:source.c
86 | - match: '(```|~~~|{%\s*highlight)\s*(cpp)\s*((?:linenos\s*)?%})?$'
87 | captures:
88 | 1: punctuation.definition.fenced.markdown
89 | 2: variable.language.fenced.markdown
90 | 3: punctuation.definition.fenced.markdown
91 | push:
92 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
93 | - meta_content_scope: source.c++
94 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
95 | captures:
96 | 1: punctuation.definition.fenced.markdown
97 | 2: variable.language.fenced.markdown
98 | 3: punctuation.definition.fenced.markdown
99 | pop: true
100 | - include: scope:source.c++
101 | - match: '(```|~~~|{%\s*highlight)\s*(coffee|coffeescript)\s*((?:linenos\s*)?%})?$'
102 | captures:
103 | 1: punctuation.definition.fenced.markdown
104 | 2: variable.language.fenced.markdown
105 | 3: punctuation.definition.fenced.markdown
106 | push:
107 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
108 | - meta_content_scope: source.coffee
109 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
110 | captures:
111 | 1: punctuation.definition.fenced.markdown
112 | 2: variable.language.fenced.markdown
113 | 3: punctuation.definition.fenced.markdown
114 | pop: true
115 | - include: scope:source.coffee
116 | - match: '(```|~~~|{%\s*highlight)\s*(jade)\s*((?:linenos\s*)?%})?$'
117 | captures:
118 | 1: punctuation.definition.fenced.markdown
119 | 2: variable.language.fenced.markdown
120 | 3: punctuation.definition.fenced.markdown
121 | push:
122 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
123 | - meta_content_scope: source.jade
124 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
125 | captures:
126 | 1: punctuation.definition.fenced.markdown
127 | 2: variable.language.fenced.markdown
128 | 3: punctuation.definition.fenced.markdown
129 | pop: true
130 | - include: scope:source.jade
131 | - match: '(```|~~~|{%\s*highlight)\s*(css)\s*((?:linenos\s*)?%})?$'
132 | captures:
133 | 1: punctuation.definition.fenced.markdown
134 | 2: variable.language.fenced.markdown
135 | 3: punctuation.definition.fenced.markdown
136 | push:
137 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
138 | - meta_content_scope: source.css
139 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
140 | captures:
141 | 1: punctuation.definition.fenced.markdown
142 | 2: variable.language.fenced.markdown
143 | 3: punctuation.definition.fenced.markdown
144 | pop: true
145 | - include: scope:source.css
146 | - match: '(```|~~~|{%\s*highlight)\s*(csharp)\s*((?:linenos\s*)?%})?$'
147 | captures:
148 | 1: punctuation.definition.fenced.markdown
149 | 2: variable.language.fenced.markdown
150 | 3: punctuation.definition.fenced.markdown
151 | push:
152 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
153 | - meta_content_scope: source.cs
154 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
155 | captures:
156 | 1: punctuation.definition.fenced.markdown
157 | 2: variable.language.fenced.markdown
158 | 3: punctuation.definition.fenced.markdown
159 | pop: true
160 | - include: scope:source.cs
161 | - match: '(```|~~~|{%\s*highlight)\s*(ejs|underscore|lodash)\s*((?:linenos\s*)?%})?$'
162 | captures:
163 | 1: punctuation.definition.fenced.markdown
164 | 2: variable.language.fenced.markdown
165 | 3: punctuation.definition.fenced.markdown
166 | push:
167 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
168 | - meta_content_scope: source.ejs
169 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
170 | captures:
171 | 1: punctuation.definition.fenced.markdown
172 | 2: variable.language.fenced.markdown
173 | 3: punctuation.definition.fenced.markdown
174 | pop: true
175 | - include: scope:source.ejs
176 | - match: '(```|~~~|{%\s*highlight)\s*(erlang)\s*((?:linenos\s*)?%})?$'
177 | captures:
178 | 1: punctuation.definition.fenced.markdown
179 | 2: variable.language.fenced.markdown
180 | 3: punctuation.definition.fenced.markdown
181 | push:
182 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
183 | - meta_content_scope: source.erlang
184 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
185 | captures:
186 | 1: punctuation.definition.fenced.markdown
187 | 2: variable.language.fenced.markdown
188 | 3: punctuation.definition.fenced.markdown
189 | pop: true
190 | - include: scope:source.erlang
191 | - match: '(```|~~~|{%\s*highlight)\s*(diff)\s*((?:linenos\s*)?%})?$'
192 | captures:
193 | 1: punctuation.definition.fenced.markdown
194 | 2: variable.language.fenced.markdown
195 | 3: punctuation.definition.fenced.markdown
196 | push:
197 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
198 | - meta_content_scope: source.diff
199 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
200 | captures:
201 | 1: punctuation.definition.fenced.markdown
202 | 2: variable.language.fenced.markdown
203 | 3: punctuation.definition.fenced.markdown
204 | pop: true
205 | - include: scope:source.diff
206 | - match: '(```|~~~|{%\s*highlight)\s*(go|golang)\s*((?:linenos\s*)?%})?$'
207 | captures:
208 | 1: punctuation.definition.fenced.markdown
209 | 2: variable.language.fenced.markdown
210 | 3: punctuation.definition.fenced.markdown
211 | push:
212 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
213 | - meta_content_scope: source.go
214 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
215 | captures:
216 | 1: punctuation.definition.fenced.markdown
217 | 2: variable.language.fenced.markdown
218 | 3: punctuation.definition.fenced.markdown
219 | pop: true
220 | - include: scope:source.go
221 | - match: '(```|~~~|{%\s*highlight)\s*(graphql)\s*((?:linenos\s*)?%})?$'
222 | captures:
223 | 1: punctuation.definition.fenced.markdown
224 | 2: variable.language.fenced.markdown
225 | 3: punctuation.definition.fenced.markdown
226 | push:
227 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
228 | - meta_content_scope: source.graphql
229 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
230 | captures:
231 | 1: punctuation.definition.fenced.markdown
232 | 2: variable.language.fenced.markdown
233 | 3: punctuation.definition.fenced.markdown
234 | pop: true
235 | - include: scope:source.graphql
236 | - match: '(```|~~~|{%\s*highlight)\s*(hbs|handlebars|html|html5)\s*((?:linenos\s*)?%})?$'
237 | captures:
238 | 1: punctuation.definition.fenced.markdown
239 | 2: variable.language.fenced.markdown
240 | 3: punctuation.definition.fenced.markdown
241 | push:
242 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
243 | - meta_content_scope: text.html.basic
244 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
245 | captures:
246 | 1: punctuation.definition.fenced.markdown
247 | 2: variable.language.fenced.markdown
248 | 3: punctuation.definition.fenced.markdown
249 | pop: true
250 | - include: scope:text.html.basic
251 | - include: scope:text.html.handlebars
252 | - match: '(```|~~~|{%\s*highlight)\s*(ini)\s*((?:linenos\s*)?%})?$'
253 | captures:
254 | 1: punctuation.definition.fenced.markdown
255 | 2: variable.language.fenced.markdown
256 | 3: punctuation.definition.fenced.markdown
257 | push:
258 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
259 | - meta_content_scope: source.ini
260 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
261 | captures:
262 | 1: punctuation.definition.fenced.markdown
263 | 2: variable.language.fenced.markdown
264 | 3: punctuation.definition.fenced.markdown
265 | pop: true
266 | - include: scope:source.ini
267 | - match: '(```|~~~|{%\s*highlight)\s*(java)\s*((?:linenos\s*)?%})?$'
268 | captures:
269 | 1: punctuation.definition.fenced.markdown
270 | 2: variable.language.fenced.markdown
271 | 3: punctuation.definition.fenced.markdown
272 | push:
273 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
274 | - meta_content_scope: source.java
275 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
276 | captures:
277 | 1: punctuation.definition.fenced.markdown
278 | 2: variable.language.fenced.markdown
279 | 3: punctuation.definition.fenced.markdown
280 | pop: true
281 | - include: scope:source.java
282 | - match: '(```|~~~|{%\s*highlight)\s*(javascript|js)\s*((?:linenos\s*)?%})?$'
283 | captures:
284 | 1: punctuation.definition.fenced.markdown
285 | 2: variable.language.fenced.markdown
286 | 3: punctuation.definition.fenced.markdown
287 | push:
288 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
289 | - meta_content_scope: source.js
290 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
291 | captures:
292 | 1: punctuation.definition.fenced.markdown
293 | 2: variable.language.fenced.markdown
294 | 3: punctuation.definition.fenced.markdown
295 | pop: true
296 | - include: scope:source.js
297 | - match: '(```|~~~|{%\s*highlight)\s*(json)\s*((?:linenos\s*)?%})?$'
298 | captures:
299 | 1: punctuation.definition.fenced.markdown
300 | 2: variable.language.fenced.markdown
301 | 3: punctuation.definition.fenced.markdown
302 | push:
303 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
304 | - meta_content_scope: source.json
305 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
306 | captures:
307 | 1: punctuation.definition.fenced.markdown
308 | 2: variable.language.fenced.markdown
309 | 3: punctuation.definition.fenced.markdown
310 | pop: true
311 | - include: scope:source.json
312 | - match: '(```|{%\s*highlight)\s*(julia|jl)\s*((?:linenos\s*)?%})?$'
313 | captures:
314 | 1: punctuation.definition.fenced.markdown
315 | 2: variable.language.fenced.markdown
316 | 3: punctuation.definition.fenced.markdown
317 | push:
318 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
319 | - meta_content_scope: source.julia
320 | - match: '(```|{%\s*endhighlight\s*%})\n'
321 | captures:
322 | 1: punctuation.definition.fenced.markdown
323 | 2: variable.language.fenced.markdown
324 | 3: punctuation.definition.fenced.markdown
325 | pop: true
326 | - include: scope:source.julia
327 | - match: '(```|{%\s*highlight)\s*(less)\s*((?:linenos\s*)?%})?$'
328 | captures:
329 | 1: punctuation.definition.fenced.markdown
330 | 2: variable.language.fenced.markdown
331 | 3: punctuation.definition.fenced.markdown
332 | push:
333 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
334 | - meta_content_scope: source.css.less
335 | - match: '(```|{%\s*endhighlight\s*%})\n'
336 | captures:
337 | 1: punctuation.definition.fenced.markdown
338 | 2: variable.language.fenced.markdown
339 | 3: punctuation.definition.fenced.markdown
340 | pop: true
341 | - include: scope:source.css.less
342 | - match: '(```|~~~|{%\s*highlight)\s*(ls|livescript|LiveScript)\s*((?:linenos\s*)?%})?$'
343 | captures:
344 | 1: punctuation.definition.fenced.markdown
345 | 2: variable.language.fenced.markdown
346 | 3: punctuation.definition.fenced.markdown
347 | push:
348 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
349 | - meta_content_scope: source.livescript
350 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
351 | captures:
352 | 1: punctuation.definition.fenced.markdown
353 | 2: variable.language.fenced.markdown
354 | 3: punctuation.definition.fenced.markdown
355 | pop: true
356 | - include: scope:source.livescript
357 | - match: '(```|~~~|{%\s*highlight)\s*(lua)\s*((?:linenos\s*)?%})?$'
358 | captures:
359 | 1: punctuation.definition.fenced.markdown
360 | 2: variable.language.fenced.markdown
361 | 3: punctuation.definition.fenced.markdown
362 | push:
363 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
364 | - meta_content_scope: source.lua
365 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
366 | captures:
367 | 1: punctuation.definition.fenced.markdown
368 | 2: variable.language.fenced.markdown
369 | 3: punctuation.definition.fenced.markdown
370 | pop: true
371 | - include: scope:source.lua
372 | - match: '(```|~~~|{%\s*highlight)\s*(md|markdown)\s*((?:linenos\s*)?%})?$'
373 | captures:
374 | 1: punctuation.definition.fenced.markdown
375 | 2: variable.language.fenced.markdown
376 | 3: punctuation.definition.fenced.markdown
377 | push:
378 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
379 | - meta_content_scope: text.html.markdown
380 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
381 | captures:
382 | 1: punctuation.definition.fenced.markdown
383 | 2: variable.language.fenced.markdown
384 | 3: punctuation.definition.fenced.markdown
385 | pop: true
386 | - include: scope:text.html.markdown
387 | - match: '(```|~~~|{%\s*highlight)\s*(nginx)\s*((?:linenos\s*)?%})?$'
388 | captures:
389 | 1: punctuation.definition.fenced.markdown
390 | 2: variable.language.fenced.markdown
391 | 3: punctuation.definition.fenced.markdown
392 | push:
393 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
394 | - meta_content_scope: source.nginx
395 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
396 | captures:
397 | 1: punctuation.definition.fenced.markdown
398 | 2: variable.language.fenced.markdown
399 | 3: punctuation.definition.fenced.markdown
400 | pop: true
401 | - include: scope:source.nginx
402 | - match: '(```|~~~|{%\s*highlight)\s*(swift)\s*((?:linenos\s*)?%})?$'
403 | captures:
404 | 1: punctuation.definition.fenced.markdown
405 | 2: variable.language.fenced.markdown
406 | 3: punctuation.definition.fenced.markdown
407 | push:
408 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
409 | - meta_content_scope: source.swift
410 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
411 | captures:
412 | 1: punctuation.definition.fenced.markdown
413 | 2: variable.language.fenced.markdown
414 | 3: punctuation.definition.fenced.markdown
415 | pop: true
416 | - include: scope:source.swift
417 | - match: '(```|~~~|{%\s*highlight)\s*(obj(?:ective\-|)c)\s*((?:linenos\s*)?%})?$'
418 | captures:
419 | 1: punctuation.definition.fenced.markdown
420 | 2: variable.language.fenced.markdown
421 | 3: punctuation.definition.fenced.markdown
422 | push:
423 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
424 | - meta_content_scope: source.objc
425 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
426 | captures:
427 | 1: punctuation.definition.fenced.markdown
428 | 2: variable.language.fenced.markdown
429 | 3: punctuation.definition.fenced.markdown
430 | pop: true
431 | - include: scope:source.objc
432 | - match: '(```|~~~|{%\s*highlight)\s*(obj(?:ective\-|)c\+\+)\s*((?:linenos\s*)?%})?$'
433 | captures:
434 | 1: punctuation.definition.fenced.markdown
435 | 2: variable.language.fenced.markdown
436 | 3: punctuation.definition.fenced.markdown
437 | push:
438 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
439 | - meta_content_scope: source.objc++
440 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
441 | captures:
442 | 1: punctuation.definition.fenced.markdown
443 | 2: variable.language.fenced.markdown
444 | 3: punctuation.definition.fenced.markdown
445 | pop: true
446 | - include: scope:source.objc++
447 | - match: '(```|~~~|{%\s*highlight)\s*(perl)\s*((?:linenos\s*)?%})?$'
448 | captures:
449 | 1: punctuation.definition.fenced.markdown
450 | 2: variable.language.fenced.markdown
451 | 3: punctuation.definition.fenced.markdown
452 | push:
453 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
454 | - meta_content_scope: source.perl
455 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
456 | captures:
457 | 1: punctuation.definition.fenced.markdown
458 | 2: variable.language.fenced.markdown
459 | 3: punctuation.definition.fenced.markdown
460 | pop: true
461 | - include: scope:source.perl
462 | - match: '(```|~~~|{%\s*highlight)\s*(php)\s*((?:linenos\s*)?%})?$'
463 | captures:
464 | 1: punctuation.definition.fenced.markdown
465 | 2: variable.language.fenced.markdown
466 | 3: punctuation.definition.fenced.markdown
467 | push:
468 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
469 | - meta_content_scope: source.php
470 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
471 | captures:
472 | 1: punctuation.definition.fenced.markdown
473 | 2: variable.language.fenced.markdown
474 | 3: punctuation.definition.fenced.markdown
475 | pop: true
476 | - include: scope:source.php
477 | - match: '(```|~~~|{%\s*highlight)\s*(python)\s*((?:linenos\s*)?%})?$'
478 | captures:
479 | 1: punctuation.definition.fenced.markdown
480 | 2: variable.language.fenced.markdown
481 | 3: punctuation.definition.fenced.markdown
482 | push:
483 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
484 | - meta_content_scope: source.python
485 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
486 | captures:
487 | 1: punctuation.definition.fenced.markdown
488 | 2: variable.language.fenced.markdown
489 | 3: punctuation.definition.fenced.markdown
490 | pop: true
491 | - include: scope:source.python
492 | - match: '(```|~~~)\s*\{?\s*(r)(?:[ \},].*$|\}?$)'
493 | captures:
494 | 1: punctuation.definition.fenced.markdown
495 | 2: variable.language.fenced.markdown
496 | 3: punctuation.definition.fenced.markdown
497 | push:
498 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
499 | - meta_content_scope: source.r
500 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
501 | captures:
502 | 1: punctuation.definition.fenced.markdown
503 | 2: variable.language.fenced.markdown
504 | 3: punctuation.definition.fenced.markdown
505 | pop: true
506 | - include: scope:source.r
507 | - match: '(```|~~~|{%\s*highlight)\s*(ruby)\s*((?:linenos\s*)?%})?$'
508 | captures:
509 | 1: punctuation.definition.fenced.markdown
510 | 2: variable.language.fenced.markdown
511 | 3: punctuation.definition.fenced.markdown
512 | push:
513 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
514 | - meta_content_scope: source.ruby
515 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
516 | captures:
517 | 1: punctuation.definition.fenced.markdown
518 | 2: variable.language.fenced.markdown
519 | 3: punctuation.definition.fenced.markdown
520 | pop: true
521 | - include: scope:source.ruby
522 | - match: '(```|~~~|{%\s*highlight)\s*(rails|erb|html\+ruby)\s*((?:linenos\s*)?%})?$'
523 | captures:
524 | 1: punctuation.definition.fenced.markdown
525 | 2: variable.language.fenced.markdown
526 | 3: punctuation.definition.fenced.markdown
527 | push:
528 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
529 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
530 | captures:
531 | 1: punctuation.definition.fenced.markdown
532 | 2: variable.language.fenced.markdown
533 | 3: punctuation.definition.fenced.markdown
534 | pop: true
535 | - match: ''
536 | push:
537 | - meta_content_scope: text.html.ruby
538 | - include: scope:text.html.ruby
539 | with_prototype:
540 | - match: '(?=(```|~~~|{%\s*endhighlight\s*%})\n)'
541 | pop: true
542 | - match: '(```|~~~|{%\s*highlight)\s*(rust)\s*((?:linenos\s*)?%})?$'
543 | captures:
544 | 1: punctuation.definition.fenced.markdown
545 | 2: variable.language.fenced.markdown
546 | 3: punctuation.definition.fenced.markdown
547 | push:
548 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
549 | - meta_content_scope: source.rust
550 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
551 | captures:
552 | 1: punctuation.definition.fenced.markdown
553 | 2: variable.language.fenced.markdown
554 | 3: punctuation.definition.fenced.markdown
555 | pop: true
556 | - include: scope:source.rust
557 | - match: '(```|~~~|{%\s*highlight)\s*(sass)\s*((?:linenos\s*)?%})?$'
558 | captures:
559 | 1: punctuation.definition.fenced.markdown
560 | 2: variable.language.fenced.markdown
561 | 3: punctuation.definition.fenced.markdown
562 | push:
563 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
564 | - meta_content_scope: source.sass
565 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
566 | captures:
567 | 1: punctuation.definition.fenced.markdown
568 | 2: variable.language.fenced.markdown
569 | 3: punctuation.definition.fenced.markdown
570 | pop: true
571 | - include: scope:source.sass
572 | - match: '(```|~~~|{%\s*highlight)\s*(scala)\s*((?:linenos\s*)?%})?$'
573 | captures:
574 | 1: punctuation.definition.fenced.markdown
575 | 2: variable.language.fenced.markdown
576 | 3: punctuation.definition.fenced.markdown
577 | push:
578 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
579 | - meta_content_scope: source.scala
580 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
581 | captures:
582 | 1: punctuation.definition.fenced.markdown
583 | 2: variable.language.fenced.markdown
584 | 3: punctuation.definition.fenced.markdown
585 | pop: true
586 | - include: scope:source.scala
587 | - match: '(```|~~~|{%\s*highlight)\s*(scss)\s*((?:linenos\s*)?%})?$'
588 | captures:
589 | 1: punctuation.definition.fenced.markdown
590 | 2: variable.language.fenced.markdown
591 | 3: punctuation.definition.fenced.markdown
592 | push:
593 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
594 | - meta_content_scope: source.scss
595 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
596 | captures:
597 | 1: punctuation.definition.fenced.markdown
598 | 2: variable.language.fenced.markdown
599 | 3: punctuation.definition.fenced.markdown
600 | pop: true
601 | - include: scope:source.scss
602 | - match: '(```|~~~|{%\s*highlight)\s*(sh|shell|bash)\s*((?:linenos\s*)?%})?$'
603 | captures:
604 | 1: punctuation.definition.fenced.markdown
605 | 2: variable.language.fenced.markdown
606 | 3: punctuation.definition.fenced.markdown
607 | push:
608 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
609 | - meta_content_scope: source.shell
610 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
611 | captures:
612 | 1: punctuation.definition.fenced.markdown
613 | 2: variable.language.fenced.markdown
614 | 3: punctuation.definition.fenced.markdown
615 | pop: true
616 | - include: scope:source.shell
617 | - match: '(```|~~~|{%\s*highlight)\s*(sql|mysql|ddl|dml)\s*((?:linenos\s*)?%})?$'
618 | captures:
619 | 1: punctuation.definition.fenced.markdown
620 | 2: variable.language.fenced.markdown
621 | 3: punctuation.definition.fenced.markdown
622 | push:
623 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
624 | - meta_content_scope: source.sql
625 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
626 | captures:
627 | 1: punctuation.definition.fenced.markdown
628 | 2: variable.language.fenced.markdown
629 | 3: punctuation.definition.fenced.markdown
630 | pop: true
631 | - include: scope:source.sql
632 | - match: '(```|~~~|{%\s*highlight)\s*(postgresql|postgres|pgsql)\s*((?:linenos\s*)?%})?$'
633 | captures:
634 | 1: punctuation.definition.fenced.markdown
635 | 2: variable.language.fenced.markdown
636 | 3: punctuation.definition.fenced.markdown
637 | push:
638 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
639 | - meta_content_scope: source.pgsql
640 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
641 | captures:
642 | 1: punctuation.definition.fenced.markdown
643 | 2: variable.language.fenced.markdown
644 | 3: punctuation.definition.fenced.markdown
645 | pop: true
646 | - include: scope:source.pgsql
647 | - match: '(```|~~~|{%\s*highlight)\s*(styl)\s*((?:linenos\s*)?%})?$'
648 | captures:
649 | 1: punctuation.definition.fenced.markdown
650 | 2: variable.language.fenced.markdown
651 | 3: punctuation.definition.fenced.markdown
652 | push:
653 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
654 | - meta_content_scope: source.stylus
655 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
656 | captures:
657 | 1: punctuation.definition.fenced.markdown
658 | 2: variable.language.fenced.markdown
659 | 3: punctuation.definition.fenced.markdown
660 | pop: true
661 | - include: scope:source.stylus
662 | - match: '(```|~~~|{%\s*highlight)\s*(swig|liquid)\s*((?:linenos\s*)?%})?$'
663 | captures:
664 | 1: punctuation.definition.fenced.markdown
665 | 2: variable.language.fenced.markdown
666 | 3: punctuation.definition.fenced.markdown
667 | push:
668 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
669 | - meta_content_scope: text.html.swig
670 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
671 | captures:
672 | 1: punctuation.definition.fenced.markdown
673 | 2: variable.language.fenced.markdown
674 | 3: punctuation.definition.fenced.markdown
675 | pop: true
676 | - include: scope:text.html.swig
677 | - match: '(```|~~~|{%\s*highlight)\s*(xml)\s*((?:linenos\s*)?%})?$'
678 | captures:
679 | 1: punctuation.definition.fenced.markdown
680 | 2: variable.language.fenced.markdown
681 | 3: punctuation.definition.fenced.markdown
682 | push:
683 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
684 | - meta_content_scope: text.xml
685 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
686 | captures:
687 | 1: punctuation.definition.fenced.markdown
688 | 2: variable.language.fenced.markdown
689 | 3: punctuation.definition.fenced.markdown
690 | pop: true
691 | - include: scope:text.xml
692 | - match: '(```|~~~|{%\s*highlight)\s*(yaml)\s*((?:linenos\s*)?%})?$'
693 | captures:
694 | 1: punctuation.definition.fenced.markdown
695 | 2: variable.language.fenced.markdown
696 | 3: punctuation.definition.fenced.markdown
697 | push:
698 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
699 | - meta_content_scope: source.yaml
700 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
701 | captures:
702 | 1: punctuation.definition.fenced.markdown
703 | 2: variable.language.fenced.markdown
704 | 3: punctuation.definition.fenced.markdown
705 | pop: true
706 | - include: scope:source.yaml
707 | - match: '(```|~~~|{%\s*highlight)\s*(\w*)\s*((?:linenos\s*)?%})?$'
708 | captures:
709 | 1: punctuation.definition.fenced.markdown
710 | 2: variable.language.fenced.markdown
711 | 3: punctuation.definition.fenced.markdown
712 | push:
713 | - meta_scope: markup.raw.block.markdown markup.raw.block.fenced.markdown
714 | - match: '(```|~~~|{%\s*endhighlight\s*%})\n'
715 | captures:
716 | 1: punctuation.definition.fenced.markdown
717 | 2: variable.language.fenced.markdown
718 | 3: punctuation.definition.fenced.markdown
719 | pop: true
720 | - match: '^[ ]{0,3}([*+-])(?=\s)'
721 | captures:
722 | 1: punctuation.definition.list_item.markdown
723 | push:
724 | - meta_scope: markup.list.unnumbered.markdown
725 | - match: ^(?=\S)
726 | captures:
727 | 1: punctuation.definition.list_item.markdown
728 | pop: true
729 | - include: list-paragraph
730 | - match: '^[ ]{0,3}([0-9]+)(\.)(?=\s)'
731 | captures:
732 | 1: punctuation.definition.list_item.markdown punctuation.definition.list_item.number.markdown
733 | 2: punctuation.definition.list_item.markdown
734 | push:
735 | - meta_scope: markup.list.numbered.markdown
736 | - match: ^(?=\S)
737 | captures:
738 | 1: punctuation.definition.list_item.markdown punctuation.definition.list_item.number.markdown
739 | 2: punctuation.definition.list_item.markdown
740 | pop: true
741 | - include: list-paragraph
742 | - match: '^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)(?!.*?\1>)'
743 | comment: Markdown formatting is disabled inside block-level tags.
744 | push:
745 | - meta_scope: meta.disable-markdown
746 | - match: (?<=^\1>$\n)
747 | pop: true
748 | - include: scope:text.html.basic
749 | - include: scope:text.html.handlebars
750 | - match: '^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)'
751 | comment: Same rule but for one line disables.
752 | push:
753 | - meta_scope: meta.disable-markdown
754 | - match: $\n?
755 | pop: true
756 | - include: scope:text.html.basic
757 | - include: scope:text.html.handlebars
758 | - match: |-
759 | (?x:
760 | \s* # Leading whitespace
761 | (\[)(.+?)(\])(:) # Reference name
762 | [ \t]* # Optional whitespace
763 | ()(\S+?)(>?) # The url
764 | [ \t]* # Optional whitespace
765 | (?:
766 | ((\().+?(\))) # Match title in quotes…
767 | | ((").+?(")) # or in parens.
768 | )? # Title is optional
769 | \s* # Optional whitespace
770 | $
771 | )
772 | scope: meta.link.reference.def.markdown
773 | captures:
774 | 1: punctuation.definition.constant.markdown
775 | 2: constant.other.reference.link.markdown
776 | 3: punctuation.definition.constant.markdown
777 | 4: punctuation.separator.key-value.markdown
778 | 5: punctuation.definition.link.markdown
779 | 6: markup.underline.link.markdown
780 | 7: punctuation.definition.link.markdown
781 | 8: string.other.link.description.title.markdown
782 | 9: punctuation.definition.string.begin.markdown
783 | 10: punctuation.definition.string.end.markdown
784 | 11: string.other.link.description.title.markdown
785 | 12: punctuation.definition.string.begin.markdown
786 | 13: punctuation.definition.string.end.markdown
787 | - match: '^(?=\S)(?![=-]{3,}(?=$))'
788 | push:
789 | - meta_scope: meta.paragraph.markdown
790 | - include: html_comment
791 | - match: '^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ \t]*\n|(?=^#)'
792 | pop: true
793 | - include: inline
794 | - include: scope:text.html.handlebars
795 | - match: '^(={3,})(?=[ \t]*$)'
796 | scope: markup.heading.1.markdown
797 | captures:
798 | 1: punctuation.definition.heading.markdown
799 | - match: '^(-{3,})(?=[ \t]*$)'
800 | scope: markup.heading.2.markdown
801 | captures:
802 | 1: punctuation.definition.heading.markdown
803 |
804 | html_comment:
805 | - match: