├── .gitignore ├── screenshot.png ├── Markdown (Github Flavored).sublime-settings ├── README.md ├── Knockdown.tmTheme └── Markdown (Github Flavored).tmLanguage /.gitignore: -------------------------------------------------------------------------------- 1 | *.cache -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/n1k0/knockdown/master/screenshot.png -------------------------------------------------------------------------------- /Markdown (Github Flavored).sublime-settings: -------------------------------------------------------------------------------- 1 | { 2 | "color_scheme": "Packages/knockdown/Knockdown.tmTheme", 3 | "auto_match_enabled": true, 4 | "draw_indent_guides": false, 5 | "caret_style": "wide", 6 | "font_face": "Consolas", 7 | "font_size": 17, 8 | "gutter": false, 9 | "line_numbers": false, 10 | "highlight_line": false, 11 | "spell_check": true, 12 | "line_padding_bottom": 2, 13 | "line_padding_top": 2, 14 | "margin": 24, 15 | "tab_size": 4, 16 | "translate_tabs_to_spaces": true, 17 | "trim_trailing_white_space_on_save": false, 18 | "word_wrap": true, 19 | "wrap_width": 90, 20 | "extensions": 21 | [ 22 | "md", 23 | "markdown", 24 | "mdown" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [Knockdown](https://github.com/aziz/knockdown) 2 | Github flavored Markdown for SublimeText and a custom color-scheme for writing markdown. 3 | 4 | ### Features: 5 | * Support for fenced code blocks 6 | * Syntax highlighting support for most popular languages (see below for the list of supported languages) 7 | * Syntax highlighting for URLs in text which is auto-linked by GFM 8 | * Proper syntax highlighting for bullets and numbers in ordered/unordered lists 9 | * Proper syntax highlighting for bold and italics by ignoring multiple underscores in words 10 | 11 | ![Screenshot](screenshot.png) 12 | 13 | ### Installation 14 | To install this plugin, you have two options: 15 | 16 | 1. If you have Package Control installed, simply search for `Knockdown` to install. 17 | 2. Clone source code to Sublime Text packages folder. 18 | 19 | > **Note:** after installing this package, open a markdow file and switch the language 20 | > to `Markdown (Github Flavored)` from the list of supported languages in your status 21 | > bar at the bottom right corner of your editor. 22 | 23 | #### Syntax Highlighting support 24 | * Coffeescript 25 | * Javascript and Json 26 | * HTML and XML 27 | * CSS 28 | * LESS 29 | * Sass and SCSS 30 | * Python 31 | * Ruby 32 | * Shell 33 | * C++ and C 34 | * Objective-C 35 | * Java 36 | * Perl 37 | * PHP 38 | * Scala 39 | * YAML 40 | * Diff 41 | * SQL 42 | 43 | ## License 44 | Copyright 2012-2013 [Allen Bargi](https://twitter.com/aziz). Licensed under the MIT License -------------------------------------------------------------------------------- /Knockdown.tmTheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | author 6 | Allen Bargi 7 | name 8 | Knockdown 9 | settings 10 | 11 | 12 | settings 13 | 14 | background 15 | #F9F9F9 16 | caret 17 | #000000 18 | foreground 19 | #080808 20 | invisibles 21 | #4B4B7E3D 22 | lineHighlight 23 | #2463B41F 24 | selection 25 | #EDDF2780 26 | 27 | 28 | 29 | name 30 | Comment 31 | scope 32 | comment 33 | settings 34 | 35 | fontStyle 36 | italic 37 | foreground 38 | #C2C2C2 39 | 40 | 41 | 42 | name 43 | Constant 44 | scope 45 | constant 46 | settings 47 | 48 | fontStyle 49 | bold 50 | foreground 51 | #830DFF 52 | 53 | 54 | 55 | name 56 | Entity 57 | scope 58 | entity 59 | settings 60 | 61 | fontStyle 62 | 63 | foreground 64 | #BF4F24 65 | 66 | 67 | 68 | name 69 | Keyword 70 | scope 71 | keyword 72 | settings 73 | 74 | fontStyle 75 | bold 76 | foreground 77 | #008000 78 | 79 | 80 | 81 | name 82 | Storage 83 | scope 84 | storage 85 | settings 86 | 87 | fontStyle 88 | bold 89 | foreground 90 | #A71D5D 91 | 92 | 93 | 94 | name 95 | String 96 | scope 97 | string | punctuation.definition.string 98 | settings 99 | 100 | foreground 101 | #FF0076 102 | 103 | 104 | 105 | 106 | name 107 | meta.image.reference.markdown punctuation.definition.string.begin.markdown 108 | scope 109 | meta.image.reference.markdown punctuation.definition.string.begin.markdown 110 | settings 111 | 112 | fontStyle 113 | normal 114 | foreground 115 | #fe007644 116 | 117 | 118 | 119 | 120 | name 121 | meta.image.reference.markdown 122 | scope 123 | meta.image.reference.markdown 124 | settings 125 | 126 | fontStyle 127 | normal 128 | foreground 129 | #fe0076 130 | 131 | 132 | 133 | 134 | name 135 | meta.image.reference.markdown punctuation.definition.constant.markdown 136 | scope 137 | meta.image.reference.markdown punctuation.definition.constant.markdown | meta.image.inline.markdown punctuation.definition.metadata.markdown 138 | settings 139 | 140 | fontStyle 141 | normal 142 | foreground 143 | #fe007644 144 | 145 | 146 | 147 | 148 | name 149 | meta.image.inline.markdown 150 | scope 151 | meta.image.inline.markdown 152 | settings 153 | 154 | fontStyle 155 | normal 156 | 157 | 158 | 159 | 160 | 161 | name 162 | meta.link.reference.def.markdown 163 | scope 164 | meta.link.reference.def.markdown 165 | settings 166 | 167 | background 168 | #0000000F 169 | 170 | 171 | 172 | 173 | name 174 | meta.link.reference.def.markdown punctuation.separator.key-value.markdown 175 | scope 176 | meta.link.reference.def.markdown punctuation.separator.key-value.markdown 177 | settings 178 | 179 | foreground 180 | #24499755 181 | 182 | 183 | 184 | 185 | name 186 | Support 187 | scope 188 | support 189 | settings 190 | 191 | foreground 192 | #691C97 193 | 194 | 195 | 196 | name 197 | Variable 198 | scope 199 | variable 200 | settings 201 | 202 | fontStyle 203 | 204 | foreground 205 | #0584FF 206 | 207 | 208 | 209 | name 210 | Punctuation.separator 211 | scope 212 | punctuation.separator 213 | settings 214 | 215 | fontStyle 216 | 217 | foreground 218 | #794938 219 | 220 | 221 | 222 | name 223 | Invalid – Deprecated 224 | scope 225 | invalid.deprecated 226 | settings 227 | 228 | fontStyle 229 | bold italic underline 230 | foreground 231 | #B52A1D 232 | 233 | 234 | 235 | name 236 | Invalid – Illegal 237 | scope 238 | invalid.illegal 239 | settings 240 | 241 | background 242 | #B52A1D 243 | fontStyle 244 | italic underline 245 | foreground 246 | #F8F8F8 247 | 248 | 249 | 250 | name 251 | String embedded-source 252 | scope 253 | string source 254 | settings 255 | 256 | background 257 | #6F8BBA26 258 | fontStyle 259 | 260 | foreground 261 | #080808 262 | 263 | 264 | 265 | name 266 | String constant 267 | scope 268 | string constant 269 | settings 270 | 271 | fontStyle 272 | bold 273 | foreground 274 | #696969 275 | 276 | 277 | 278 | name 279 | String variable 280 | scope 281 | string variable 282 | settings 283 | 284 | fontStyle 285 | 286 | foreground 287 | #234A97 288 | 289 | 290 | 291 | name 292 | String.regexp 293 | scope 294 | string.regexp 295 | settings 296 | 297 | fontStyle 298 | 299 | foreground 300 | #CF5628 301 | 302 | 303 | 304 | name 305 | String.regexp.«special» 306 | scope 307 | string.regexp.character-class, string.regexp constant.character.escaped, string.regexp source.ruby.embedded, string.regexp string.regexp.arbitrary-repitition 308 | settings 309 | 310 | fontStyle 311 | bold italic 312 | foreground 313 | #CF5628 314 | 315 | 316 | 317 | name 318 | escape chars 319 | scope 320 | constant.character.escape.markdown 321 | settings 322 | 323 | fontStyle 324 | normal 325 | foreground 326 | #000000 327 | 328 | 329 | 330 | 331 | name 332 | String.regexp constant.character.escape 333 | scope 334 | string.regexp constant.character.escape 335 | settings 336 | 337 | fontStyle 338 | bold 339 | foreground 340 | #811F24 341 | 342 | 343 | 344 | name 345 | Embedded Source 346 | scope 347 | text source 348 | settings 349 | 350 | background 351 | #6F8BBA26 352 | 353 | 354 | 355 | name 356 | Support.function 357 | scope 358 | support.function 359 | settings 360 | 361 | fontStyle 362 | bold 363 | foreground 364 | #218000 365 | 366 | 367 | 368 | name 369 | Support.constant 370 | scope 371 | support.constant 372 | settings 373 | 374 | fontStyle 375 | 376 | foreground 377 | #B4371F 378 | 379 | 380 | 381 | name 382 | Support.variable 383 | scope 384 | support.variable 385 | settings 386 | 387 | foreground 388 | #234A97 389 | 390 | 391 | 402 | 403 | name 404 | punctuation.definition.list_item.markdown 405 | scope 406 | punctuation.definition.list_item.markdown 407 | settings 408 | 409 | foreground 410 | #93a1a1 411 | 412 | 413 | 414 | name 415 | punctuation.definition.raw.markdown 416 | scope 417 | punctuation.definition.raw.markdown 418 | settings 419 | 420 | foreground 421 | #00000044 422 | 423 | 424 | 425 | 426 | name 427 | Markup.heading 428 | scope 429 | markup.heading | markup.heading entity.name 430 | settings 431 | 432 | fontStyle 433 | bold 434 | foreground 435 | #0E39FF 436 | 437 | 438 | 439 | 440 | 441 | name 442 | Markup.heading 443 | scope 444 | markup.heading.markdown punctuation.definition.heading.markdown 445 | settings 446 | 447 | fontStyle 448 | normal 449 | foreground 450 | #0E39FF44 451 | 452 | 453 | 454 | 455 | 456 | name 457 | Markup.quote 458 | scope 459 | markup.quote 460 | settings 461 | 462 | background 463 | #BBBBBB40 464 | fontStyle 465 | italic 466 | foreground 467 | #009F27 468 | 469 | 470 | 471 | name 472 | punctuation.definition.blockquote.markdown 473 | scope 474 | punctuation.definition.blockquote.markdown 475 | settings 476 | 477 | fontStyle 478 | normal 479 | foreground 480 | #009F2744 481 | 482 | 483 | 484 | name 485 | meta.link.email.lt-gt.markdown punctuation.definition.link.markdown 486 | scope 487 | meta.link.email.lt-gt.markdown punctuation.definition.link.markdown 488 | settings 489 | 490 | fontStyle 491 | normal 492 | foreground 493 | #24499733 494 | 495 | 496 | 497 | name 498 | meta.link punctuation.definition.string.begin.markdown 499 | scope 500 | meta.link punctuation.definition.string.begin.markdown 501 | settings 502 | 503 | fontStyle 504 | normal 505 | foreground 506 | #fe007644 507 | 508 | 509 | 510 | name 511 | meta.link punctuation.definition.string.end.markdown 512 | scope 513 | meta.link punctuation.definition.string.end.markdown 514 | settings 515 | 516 | fontStyle 517 | normal 518 | foreground 519 | #fe007644 520 | 521 | 522 | 523 | name 524 | meta.link punctuation.definition 525 | scope 526 | meta.link punctuation.definition 527 | settings 528 | 529 | fontStyle 530 | normal 531 | foreground 532 | #24499733 533 | 534 | 535 | 536 | 537 | name 538 | Markup.italic 539 | scope 540 | markup.italic 541 | settings 542 | 543 | fontStyle 544 | italic 545 | foreground 546 | #d06339 547 | 548 | 549 | 550 | name 551 | punctuation.definition.italic.markdown 552 | scope 553 | punctuation.definition.italic.markdown 554 | settings 555 | 556 | fontStyle 557 | normal 558 | foreground 559 | #d0633944 560 | 561 | 562 | 563 | name 564 | punctuation.definition.bold.markdown 565 | scope 566 | punctuation.definition.bold.markdown 567 | settings 568 | 569 | fontStyle 570 | normal 571 | foreground 572 | #00000022 573 | 574 | 575 | 576 | 577 | name 578 | markup.bold.markdown markup.italic.markdown 579 | scope 580 | markup.bold.markdown markup.italic.markdown 581 | settings 582 | 583 | fontStyle 584 | bold italic 585 | foreground 586 | #d06339 587 | 588 | 589 | 590 | 591 | name 592 | Markup.bold 593 | scope 594 | markup.bold 595 | settings 596 | 597 | fontStyle 598 | bold 599 | 600 | 601 | 602 | name 603 | Markup.link 604 | scope 605 | markup.underline.link 606 | settings 607 | 608 | foreground 609 | #0088cc 610 | 611 | 612 | 613 | name 614 | Markup.underline 615 | scope 616 | markup.underline 617 | settings 618 | 619 | fontStyle 620 | underline 621 | 622 | 623 | 624 | name 625 | Markup.raw 626 | scope 627 | markup.raw 628 | settings 629 | 630 | background 631 | #BBBBBB3D 632 | fontStyle 633 | 634 | foreground 635 | #009F27 636 | 637 | 638 | 639 | name 640 | Markup.deleted 641 | scope 642 | markup.deleted 643 | settings 644 | 645 | foreground 646 | #59140E 647 | 648 | 649 | 650 | name 651 | Markup.citation 652 | scope 653 | markup.citation 654 | settings 655 | 656 | background 657 | #FF9CF338 658 | fontStyle 659 | underline 660 | foreground 661 | #830CFF 662 | 663 | 664 | 665 | name 666 | Markup.footnote 667 | scope 668 | markup.footnote | meta.footnote 669 | settings 670 | 671 | background 672 | #C3F3FCE0 673 | 674 | 675 | 676 | name 677 | Markup.table 678 | scope 679 | markup.table 680 | settings 681 | 682 | background 683 | #FF3A281A 684 | foreground 685 | #B42A1D 686 | 687 | 688 | 689 | name 690 | Meta.image 691 | scope 692 | meta.image 693 | settings 694 | 695 | background 696 | #fedb4155 697 | foreground 698 | #F40576 699 | 700 | 701 | 702 | name 703 | Meta.separator 704 | scope 705 | meta.separator 706 | settings 707 | 708 | background 709 | #1053fc22 710 | fontStyle 711 | 712 | foreground 713 | #FFFFFF 714 | 715 | 716 | 717 | name 718 | Raw Block 719 | scope 720 | markup.raw.block.fenced.markdown 721 | settings 722 | 723 | background 724 | #222 725 | 726 | 727 | 728 | 729 | name 730 | Fenced Code Block 731 | scope 732 | punctuation.definition.fenced.markdown,variable.language.fenced.markdown 733 | settings 734 | 735 | foreground 736 | #222222cc 737 | 738 | 739 | 740 | uuid 741 | 1D07ACC0-832F-11E2-9E96-0800200C9A66 742 | 743 | 744 | -------------------------------------------------------------------------------- /Markdown (Github Flavored).tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | mdown 8 | markdown 9 | markdn 10 | md 11 | 12 | foldingStartMarker 13 | (?x) 14 | (<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\b.*?> 15 | |<!--(?!.*-->) 16 | |\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/))) 17 | ) 18 | foldingStopMarker 19 | (?x) 20 | (</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)> 21 | |^\s*--> 22 | |(^|\s)\} 23 | ) 24 | keyEquivalent 25 | ^~M 26 | name 27 | Markdown (Github Flavored) 28 | patterns 29 | 30 | 47 | 48 | begin 49 | (?x)^ 50 | (?= [ ]{,3}>. 51 | | ([ ]{4}|\t)(?!$) 52 | | [#]{1,6}\s*+ 53 | | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ 54 | ) 55 | comment 56 | 57 | We could also use an empty end match and set 58 | applyEndPatternLast, but then we must be sure that the begin 59 | pattern will only match stuff matched by the sub-patterns. 60 | 61 | end 62 | (?x)^ 63 | (?! [ ]{,3}>. 64 | | ([ ]{4}|\t) 65 | | [#]{1,6}\s*+ 66 | | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ 67 | ) 68 | name 69 | meta.block-level.markdown 70 | patterns 71 | 72 | 73 | include 74 | #block_quote 75 | 76 | 77 | include 78 | #block_raw 79 | 80 | 81 | include 82 | #heading 83 | 84 | 85 | include 86 | #separator 87 | 88 | 89 | 90 | 91 | 92 | begin 93 | (```)\s*(html|html5)\s*$ 94 | captures 95 | 96 | 1 97 | 98 | name 99 | punctuation.definition.fenced.markdown 100 | 101 | 2 102 | 103 | name 104 | variable.language.fenced.markdown 105 | 106 | 107 | end 108 | (\1)\n 109 | name 110 | markup.raw.block.markdown markup.raw.block.fenced.markdown 111 | patterns 112 | 113 | 114 | include 115 | text.html.basic 116 | 117 | 118 | 119 | 120 | 121 | begin 122 | (```)\s*(xml)\s*$ 123 | captures 124 | 125 | 1 126 | 127 | name 128 | punctuation.definition.fenced.markdown 129 | 130 | 2 131 | 132 | name 133 | variable.language.fenced.markdown 134 | 135 | 136 | end 137 | (\1)\n 138 | name 139 | markup.raw.block.markdown markup.raw.block.fenced.markdown 140 | patterns 141 | 142 | 143 | include 144 | text.xml 145 | 146 | 147 | 148 | 149 | 150 | begin 151 | (```)\s*(diff)\s*$ 152 | captures 153 | 154 | 1 155 | 156 | name 157 | punctuation.definition.fenced.markdown 158 | 159 | 2 160 | 161 | name 162 | variable.language.fenced.markdown 163 | 164 | 165 | end 166 | (\1)\n 167 | name 168 | markup.raw.block.markdown markup.raw.block.fenced.markdown 169 | patterns 170 | 171 | 172 | include 173 | source.diff 174 | 175 | 176 | 177 | 178 | 179 | begin 180 | (```)\s*(perl)\s*$ 181 | captures 182 | 183 | 1 184 | 185 | name 186 | punctuation.definition.fenced.markdown 187 | 188 | 2 189 | 190 | name 191 | variable.language.fenced.markdown 192 | 193 | 194 | end 195 | (\1)\n 196 | name 197 | markup.raw.block.markdown markup.raw.block.fenced.markdown 198 | patterns 199 | 200 | 201 | include 202 | source.perl 203 | 204 | 205 | 206 | 207 | 208 | begin 209 | (```)\s*(php)\s*$ 210 | captures 211 | 212 | 1 213 | 214 | name 215 | punctuation.definition.fenced.markdown 216 | 217 | 2 218 | 219 | name 220 | variable.language.fenced.markdown 221 | 222 | 223 | end 224 | (\1)\n 225 | name 226 | markup.raw.block.markdown markup.raw.block.fenced.markdown 227 | patterns 228 | 229 | 230 | include 231 | source.php 232 | 233 | 234 | 235 | 236 | 237 | 238 | begin 239 | (```)\s*(css)\s*$ 240 | captures 241 | 242 | 1 243 | 244 | name 245 | punctuation.definition.fenced.markdown 246 | 247 | 2 248 | 249 | name 250 | variable.language.fenced.markdown 251 | 252 | 253 | end 254 | (\1)\n 255 | name 256 | markup.raw.block.markdown markup.raw.block.fenced.markdown 257 | patterns 258 | 259 | 260 | include 261 | source.css 262 | 263 | 264 | 265 | 266 | 267 | begin 268 | (```)\s*(less)\s*$ 269 | captures 270 | 271 | 1 272 | 273 | name 274 | punctuation.definition.fenced.markdown 275 | 276 | 2 277 | 278 | name 279 | variable.language.fenced.markdown 280 | 281 | 282 | end 283 | (\1)\n 284 | name 285 | markup.raw.block.markdown markup.raw.block.fenced.markdown 286 | patterns 287 | 288 | 289 | include 290 | source.css.less 291 | 292 | 293 | 294 | 295 | 296 | begin 297 | (```)\s*(java)\s*$ 298 | captures 299 | 300 | 1 301 | 302 | name 303 | punctuation.definition.fenced.markdown 304 | 305 | 2 306 | 307 | name 308 | variable.language.fenced.markdown 309 | 310 | 311 | end 312 | (\1)\n 313 | name 314 | markup.raw.block.markdown markup.raw.block.fenced.markdown 315 | patterns 316 | 317 | 318 | include 319 | source.java 320 | 321 | 322 | 323 | 324 | 325 | begin 326 | (```)\s*(c)\s*$ 327 | captures 328 | 329 | 1 330 | 331 | name 332 | punctuation.definition.fenced.markdown 333 | 334 | 2 335 | 336 | name 337 | variable.language.fenced.markdown 338 | 339 | 340 | end 341 | (\1)\n 342 | name 343 | markup.raw.block.markdown markup.raw.block.fenced.markdown 344 | patterns 345 | 346 | 347 | include 348 | source.c 349 | 350 | 351 | 352 | 353 | 354 | 355 | begin 356 | (```)\s*(c\+\+)\s*$ 357 | captures 358 | 359 | 1 360 | 361 | name 362 | punctuation.definition.fenced.markdown 363 | 364 | 2 365 | 366 | name 367 | variable.language.fenced.markdown 368 | 369 | 370 | end 371 | (\1)\n 372 | name 373 | markup.raw.block.markdown markup.raw.block.fenced.markdown 374 | patterns 375 | 376 | 377 | include 378 | source.c++ 379 | 380 | 381 | 382 | 383 | 384 | begin 385 | (```)\s*(yaml)\s*$ 386 | captures 387 | 388 | 1 389 | 390 | name 391 | punctuation.definition.fenced.markdown 392 | 393 | 2 394 | 395 | name 396 | variable.language.fenced.markdown 397 | 398 | 399 | end 400 | (\1)\n 401 | name 402 | markup.raw.block.markdown markup.raw.block.fenced.markdown 403 | patterns 404 | 405 | 406 | include 407 | source.yaml 408 | 409 | 410 | 411 | 412 | 413 | begin 414 | (```)\s*(sql)\s*$ 415 | captures 416 | 417 | 1 418 | 419 | name 420 | punctuation.definition.fenced.markdown 421 | 422 | 2 423 | 424 | name 425 | variable.language.fenced.markdown 426 | 427 | 428 | end 429 | (\1)\n 430 | name 431 | markup.raw.block.markdown markup.raw.block.fenced.markdown 432 | patterns 433 | 434 | 435 | include 436 | source.sql 437 | 438 | 439 | 440 | 441 | 442 | begin 443 | (```)\s*(shell)\s*$ 444 | captures 445 | 446 | 1 447 | 448 | name 449 | punctuation.definition.fenced.markdown 450 | 451 | 2 452 | 453 | name 454 | variable.language.fenced.markdown 455 | 456 | 457 | end 458 | (\1)\n 459 | name 460 | markup.raw.block.markdown markup.raw.block.fenced.markdown 461 | patterns 462 | 463 | 464 | include 465 | source.shell 466 | 467 | 468 | 469 | 470 | 471 | begin 472 | (```)\s*(sass|scss)\s*$ 473 | captures 474 | 475 | 1 476 | 477 | name 478 | punctuation.definition.fenced.markdown 479 | 480 | 2 481 | 482 | name 483 | variable.language.fenced.markdown 484 | 485 | 486 | end 487 | (\1)\n 488 | name 489 | markup.raw.block.markdown markup.raw.block.fenced.markdown 490 | patterns 491 | 492 | 493 | include 494 | source.sass 495 | 496 | 497 | 498 | 499 | 500 | begin 501 | (```)\s*(scala)\s*$ 502 | captures 503 | 504 | 1 505 | 506 | name 507 | punctuation.definition.fenced.markdown 508 | 509 | 2 510 | 511 | name 512 | variable.language.fenced.markdown 513 | 514 | 515 | end 516 | (\1)\n 517 | name 518 | markup.raw.block.markdown markup.raw.block.fenced.markdown 519 | patterns 520 | 521 | 522 | include 523 | source.scala 524 | 525 | 526 | 527 | 528 | 529 | begin 530 | (```)\s*(objective-c)\s*$ 531 | captures 532 | 533 | 1 534 | 535 | name 536 | punctuation.definition.fenced.markdown 537 | 538 | 2 539 | 540 | name 541 | variable.language.fenced.markdown 542 | 543 | 544 | end 545 | (\1)\n 546 | name 547 | markup.raw.block.markdown markup.raw.block.fenced.markdown 548 | patterns 549 | 550 | 551 | include 552 | source.objc 553 | 554 | 555 | 556 | 557 | 558 | begin 559 | (```)\s*(python)\s*$ 560 | captures 561 | 562 | 1 563 | 564 | name 565 | punctuation.definition.fenced.markdown 566 | 567 | 2 568 | 569 | name 570 | variable.language.fenced.markdown 571 | 572 | 573 | end 574 | (\1)\n 575 | name 576 | markup.raw.block.markdown markup.raw.block.fenced.markdown 577 | patterns 578 | 579 | 580 | include 581 | source.python 582 | 583 | 584 | 585 | 586 | 587 | begin 588 | (```)\s*(coffee)\s*$ 589 | captures 590 | 591 | 1 592 | 593 | name 594 | punctuation.definition.fenced.markdown 595 | 596 | 2 597 | 598 | name 599 | variable.language.fenced.markdown 600 | 601 | 602 | end 603 | (\1)\n 604 | name 605 | markup.raw.block.markdown markup.raw.block.fenced.markdown 606 | patterns 607 | 608 | 609 | include 610 | source.coffee 611 | 612 | 613 | 614 | 615 | 616 | begin 617 | (```)\s*(js|json|javascript)\s*$ 618 | captures 619 | 620 | 1 621 | 622 | name 623 | punctuation.definition.fenced.markdown 624 | 625 | 2 626 | 627 | name 628 | variable.language.fenced.markdown 629 | 630 | 631 | end 632 | (\1)\n 633 | name 634 | markup.raw.block.markdown markup.raw.block.fenced.markdown 635 | patterns 636 | 637 | 638 | include 639 | source.js 640 | 641 | 642 | 643 | 644 | 645 | begin 646 | (```)\s*(ruby)\s*$ 647 | captures 648 | 649 | 1 650 | 651 | name 652 | punctuation.definition.fenced.markdown 653 | 654 | 2 655 | 656 | name 657 | variable.language.fenced.markdown 658 | 659 | 660 | end 661 | (\1)\n 662 | name 663 | markup.raw.block.markdown markup.raw.block.fenced.markdown 664 | patterns 665 | 666 | 667 | include 668 | source.ruby 669 | 670 | 671 | 672 | 673 | 674 | begin 675 | (```)\s*(\w*)\s*$ 676 | captures 677 | 678 | 1 679 | 680 | name 681 | punctuation.definition.fenced.markdown 682 | 683 | 2 684 | 685 | name 686 | variable.language.fenced.markdown 687 | 688 | 689 | end 690 | (\1)\n 691 | name 692 | markup.raw.block.markdown markup.raw.block.fenced.markdown 693 | 694 | 695 | 696 | begin 697 | ^[ ]{0,3}([*+-])(?=\s) 698 | captures 699 | 700 | 1 701 | 702 | name 703 | punctuation.definition.list_item.markdown 704 | 705 | 706 | end 707 | ^(?=\S) 708 | name 709 | markup.list.unnumbered.markdown 710 | patterns 711 | 712 | 713 | include 714 | #list-paragraph 715 | 716 | 717 | 718 | 719 | 720 | begin 721 | ^[ ]{0,3}([0-9]+)(\.)(?=\s) 722 | captures 723 | 724 | 1 725 | 726 | name 727 | punctuation.definition.list_item.markdown punctuation.definition.list_item.number.markdown 728 | 729 | 2 730 | 731 | name 732 | punctuation.definition.list_item.markdown 733 | 734 | 735 | end 736 | ^(?=\S) 737 | name 738 | markup.list.numbered.markdown 739 | patterns 740 | 741 | 742 | include 743 | #list-paragraph 744 | 745 | 746 | 747 | 748 | 749 | begin 750 | ^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b)(?!.*?</\1>) 751 | comment 752 | 753 | Markdown formatting is disabled inside block-level tags. 754 | 755 | end 756 | (?<=^</\1>$\n) 757 | name 758 | meta.disable-markdown 759 | patterns 760 | 761 | 762 | include 763 | text.html.basic 764 | 765 | 766 | 767 | 768 | 769 | begin 770 | ^(?=<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b) 771 | comment 772 | Same rule but for one line disables. 773 | end 774 | $\n? 775 | name 776 | meta.disable-markdown 777 | patterns 778 | 779 | 780 | include 781 | text.html.basic 782 | 783 | 784 | 785 | 786 | 787 | captures 788 | 789 | 1 790 | 791 | name 792 | punctuation.definition.constant.markdown 793 | 794 | 10 795 | 796 | name 797 | punctuation.definition.string.end.markdown 798 | 799 | 11 800 | 801 | name 802 | string.other.link.description.title.markdown 803 | 804 | 12 805 | 806 | name 807 | punctuation.definition.string.begin.markdown 808 | 809 | 13 810 | 811 | name 812 | punctuation.definition.string.end.markdown 813 | 814 | 2 815 | 816 | name 817 | constant.other.reference.link.markdown 818 | 819 | 3 820 | 821 | name 822 | punctuation.definition.constant.markdown 823 | 824 | 4 825 | 826 | name 827 | punctuation.separator.key-value.markdown 828 | 829 | 5 830 | 831 | name 832 | punctuation.definition.link.markdown 833 | 834 | 6 835 | 836 | name 837 | markup.underline.link.markdown 838 | 839 | 7 840 | 841 | name 842 | punctuation.definition.link.markdown 843 | 844 | 8 845 | 846 | name 847 | string.other.link.description.title.markdown 848 | 849 | 9 850 | 851 | name 852 | punctuation.definition.string.begin.markdown 853 | 854 | 855 | match 856 | (?x: 857 | \s* # Leading whitespace 858 | (\[)(.+?)(\])(:) # Reference name 859 | [ \t]* # Optional whitespace 860 | (<?)(\S+?)(>?) # The url 861 | [ \t]* # Optional whitespace 862 | (?: 863 | ((\().+?(\))) # Match title in quotes… 864 | | ((").+?(")) # or in parens. 865 | )? # Title is optional 866 | \s* # Optional whitespace 867 | $ 868 | ) 869 | name 870 | meta.link.reference.def.markdown 871 | 872 | 873 | 874 | begin 875 | ^(?=\S)(?![=-]{3,}(?=$)) 876 | end 877 | ^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ \t]*\n|(?=^#) 878 | name 879 | meta.paragraph.markdown 880 | patterns 881 | 882 | 883 | include 884 | #inline 885 | 886 | 887 | include 888 | text.html.basic 889 | 890 | 891 | captures 892 | 893 | 1 894 | 895 | name 896 | punctuation.definition.heading.markdown 897 | 898 | 899 | match 900 | ^(={3,})(?=[ \t]*$) 901 | name 902 | markup.heading.1.markdown 903 | 904 | 905 | captures 906 | 907 | 1 908 | 909 | name 910 | punctuation.definition.heading.markdown 911 | 912 | 913 | match 914 | ^(-{3,})(?=[ \t]*$) 915 | name 916 | markup.heading.2.markdown 917 | 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | repository 927 | 928 | 929 | ampersand 930 | 931 | comment 932 | 933 | Markdown will convert this for us. We match it so that the 934 | HTML grammar will not mark it up as invalid. 935 | 936 | match 937 | &(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);) 938 | name 939 | meta.other.valid-ampersand.markdown 940 | 941 | 942 | 943 | block_quote 944 | 945 | begin 946 | \G[ ]{,3}(>)(?!$)[ ]? 947 | beginCaptures 948 | 949 | 1 950 | 951 | name 952 | punctuation.definition.blockquote.markdown 953 | 954 | 955 | comment 956 | 957 | We terminate the block quote when seeing an empty line, a 958 | separator or a line with leading > characters. The latter is 959 | to “reset” the quote level for quoted lines. 960 | 961 | end 962 | (?x)^ 963 | (?= \s*$ 964 | | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ 965 | | [ ]{,3}>. 966 | ) 967 | name 968 | markup.quote.markdown 969 | patterns 970 | 971 | 972 | begin 973 | (?x)\G 974 | (?= [ ]{,3}>. 975 | ) 976 | end 977 | ^ 978 | patterns 979 | 980 | 981 | include 982 | #block_quote 983 | 984 | 985 | 986 | 987 | applyEndPatternLast 988 | 1 989 | begin 990 | (?x)\G 991 | (?= ([ ]{4}|\t) 992 | | [#]{1,6}\s*+ 993 | | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ 994 | ) 995 | end 996 | ^ 997 | patterns 998 | 999 | 1000 | include 1001 | #block_raw 1002 | 1003 | 1004 | include 1005 | #heading 1006 | 1007 | 1008 | include 1009 | #separator 1010 | 1011 | 1012 | 1013 | 1014 | begin 1015 | (?x)\G 1016 | (?! $ 1017 | | [ ]{,3}>. 1018 | | ([ ]{4}|\t) 1019 | | [#]{1,6}\s*+ 1020 | | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ 1021 | ) 1022 | end 1023 | $|(?<=\n) 1024 | patterns 1025 | 1026 | 1027 | include 1028 | #inline 1029 | 1030 | 1031 | 1032 | 1033 | 1034 | 1035 | 1036 | block_raw 1037 | 1038 | match 1039 | \G([ ]{4}|\t).*$\n? 1040 | name 1041 | markup.raw.block.markdown 1042 | 1043 | 1044 | 1045 | bracket 1046 | 1047 | comment 1048 | 1049 | Markdown will convert this for us. We match it so that the 1050 | HTML grammar will not mark it up as invalid. 1051 | 1052 | match 1053 | <(?![a-z/?\$!]) 1054 | name 1055 | meta.other.valid-bracket.markdown 1056 | 1057 | 1058 | 1059 | escape 1060 | 1061 | match 1062 | \\[-`*_#+.!(){}\[\]\\>] 1063 | name 1064 | constant.character.escape.markdown 1065 | 1066 | 1067 | 1068 | heading 1069 | 1070 | begin 1071 | \G(#{1,6})(?!#)\s*(?=\S) 1072 | captures 1073 | 1074 | 1 1075 | 1076 | name 1077 | punctuation.definition.heading.markdown 1078 | 1079 | 1080 | contentName 1081 | entity.name.section.markdown 1082 | end 1083 | \s*(#*)$\n? 1084 | name 1085 | markup.heading.markdown 1086 | patterns 1087 | 1088 | 1089 | include 1090 | #inline 1091 | 1092 | 1093 | 1094 | 1095 | 1096 | image-inline 1097 | 1098 | captures 1099 | 1100 | 1 1101 | 1102 | name 1103 | punctuation.definition.string.begin.markdown 1104 | 1105 | 10 1106 | 1107 | name 1108 | string.other.link.description.title.markdown 1109 | 1110 | 11 1111 | 1112 | name 1113 | punctuation.definition.string.markdown 1114 | 1115 | 12 1116 | 1117 | name 1118 | punctuation.definition.string.markdown 1119 | 1120 | 13 1121 | 1122 | name 1123 | string.other.link.description.title.markdown 1124 | 1125 | 14 1126 | 1127 | name 1128 | punctuation.definition.string.markdown 1129 | 1130 | 15 1131 | 1132 | name 1133 | punctuation.definition.string.markdown 1134 | 1135 | 16 1136 | 1137 | name 1138 | punctuation.definition.metadata.markdown 1139 | 1140 | 2 1141 | 1142 | name 1143 | string.other.link.description.markdown 1144 | 1145 | 3 1146 | 1147 | name 1148 | punctuation.definition.string.end.markdown 1149 | 1150 | 5 1151 | 1152 | name 1153 | invalid.illegal.whitespace.markdown 1154 | 1155 | 6 1156 | 1157 | name 1158 | punctuation.definition.metadata.markdown 1159 | 1160 | 7 1161 | 1162 | name 1163 | punctuation.definition.link.markdown 1164 | 1165 | 8 1166 | 1167 | name 1168 | markup.underline.link.image.markdown 1169 | 1170 | 9 1171 | 1172 | name 1173 | punctuation.definition.link.markdown 1174 | 1175 | 1176 | match 1177 | (?x: 1178 | \! # Images start with ! 1179 | (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) 1180 | # Match the link text. 1181 | ([ ])? # Space not allowed 1182 | (\() # Opening paren for url 1183 | (<?)(\S+?)(>?) # The url 1184 | [ \t]* # Optional whitespace 1185 | (?: 1186 | ((\().+?(\))) # Match title in parens… 1187 | | ((").+?(")) # or in quotes. 1188 | )? # Title is optional 1189 | \s* # Optional whitespace 1190 | (\)) 1191 | ) 1192 | name 1193 | meta.image.inline.markdown 1194 | 1195 | 1196 | 1197 | image-ref 1198 | 1199 | captures 1200 | 1201 | 1 1202 | 1203 | name 1204 | punctuation.definition.string.begin.markdown 1205 | 1206 | 2 1207 | 1208 | name 1209 | string.other.link.description.markdown 1210 | 1211 | 4 1212 | 1213 | name 1214 | punctuation.definition.string.begin.markdown 1215 | 1216 | 5 1217 | 1218 | name 1219 | punctuation.definition.constant.markdown 1220 | 1221 | 6 1222 | 1223 | name 1224 | constant.other.reference.link.markdown 1225 | 1226 | 7 1227 | 1228 | name 1229 | punctuation.definition.constant.markdown 1230 | 1231 | 1232 | match 1233 | \!(\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(.*?)(\]) 1234 | name 1235 | meta.image.reference.markdown 1236 | 1237 | 1238 | 1239 | inline 1240 | 1241 | patterns 1242 | 1243 | 1244 | include 1245 | #escape 1246 | 1247 | 1248 | include 1249 | #ampersand 1250 | 1251 | 1252 | include 1253 | #bracket 1254 | 1255 | 1256 | include 1257 | #raw 1258 | 1259 | 1260 | include 1261 | #bold 1262 | 1263 | 1264 | include 1265 | #italic 1266 | 1267 | 1268 | include 1269 | #line-break 1270 | 1271 | 1272 | include 1273 | #image-inline 1274 | 1275 | 1276 | include 1277 | #link-inline 1278 | 1279 | 1280 | include 1281 | #link-inet 1282 | 1283 | 1284 | include 1285 | #link-email 1286 | 1287 | 1288 | include 1289 | #image-ref 1290 | 1291 | 1292 | include 1293 | #link-ref-literal 1294 | 1295 | 1296 | include 1297 | #link-ref 1298 | 1299 | 1300 | include 1301 | #plain-uri 1302 | 1303 | 1304 | 1305 | 1306 | 1307 | italic 1308 | 1309 | begin 1310 | (?x) 1311 | (?:^|\s)(\*|_)(?=\S) # Open 1312 | (?= 1313 | ( 1314 | <[^>]*+> # HTML tags 1315 | | (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> 1316 | # Raw 1317 | | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes 1318 | | \[ 1319 | ( 1320 | (?<square> # Named group 1321 | [^\[\]\\] # Match most chars 1322 | | \\. # Escaped chars 1323 | | \[ \g<square>*+ \] # Nested brackets 1324 | )*+ 1325 | \] 1326 | ( 1327 | ( # Reference Link 1328 | [ ]? # Optional space 1329 | \[[^\]]*+\] # Ref name 1330 | ) 1331 | | ( # Inline Link 1332 | \( # Opening paren 1333 | [ \t]*+ # Optional whtiespace 1334 | <?(.*?)>? # URL 1335 | [ \t]*+ # Optional whtiespace 1336 | ( # Optional Title 1337 | (?<title>['"]) 1338 | (.*?) 1339 | \k<title> 1340 | )? 1341 | \) 1342 | ) 1343 | ) 1344 | ) 1345 | | \1\1 # Must be bold closer 1346 | | (?!(?<=\S)\1). # Everything besides 1347 | # style closer 1348 | )++ 1349 | (?<=\S)\1(?:\s) # Close 1350 | ) 1351 | 1352 | 1353 | captures 1354 | 1355 | 1 1356 | 1357 | name 1358 | punctuation.definition.italic.markdown 1359 | 1360 | 1361 | end 1362 | (?<=\S)(\1)((?!\1)|(?=\1\1)) 1363 | name 1364 | markup.italic.markdown 1365 | patterns 1366 | 1367 | 1368 | applyEndPatternLast 1369 | 1 1370 | begin 1371 | (?=<[^>]*?>) 1372 | end 1373 | (?<=>) 1374 | patterns 1375 | 1376 | 1377 | include 1378 | text.html.basic 1379 | 1380 | 1381 | 1382 | 1383 | include 1384 | #escape 1385 | 1386 | 1387 | include 1388 | #ampersand 1389 | 1390 | 1391 | include 1392 | #bracket 1393 | 1394 | 1395 | include 1396 | #raw 1397 | 1398 | 1399 | include 1400 | #bold 1401 | 1402 | 1403 | include 1404 | #image-inline 1405 | 1406 | 1407 | include 1408 | #link-inline 1409 | 1410 | 1411 | include 1412 | #link-inet 1413 | 1414 | 1415 | include 1416 | #link-email 1417 | 1418 | 1419 | include 1420 | #image-ref 1421 | 1422 | 1423 | include 1424 | #link-ref-literal 1425 | 1426 | 1427 | include 1428 | #link-ref 1429 | 1430 | 1431 | 1432 | 1433 | line-break 1434 | 1435 | match 1436 | {2,}$ 1437 | name 1438 | meta.dummy.line-break 1439 | 1440 | 1441 | link-email 1442 | 1443 | captures 1444 | 1445 | 1 1446 | 1447 | name 1448 | punctuation.definition.link.markdown 1449 | 1450 | 2 1451 | 1452 | name 1453 | markup.underline.link.markdown 1454 | 1455 | 4 1456 | 1457 | name 1458 | punctuation.definition.link.markdown 1459 | 1460 | 1461 | match 1462 | (<)((?:mailto:)?[-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(>) 1463 | name 1464 | meta.link.email.lt-gt.markdown 1465 | 1466 | 1467 | link-inet 1468 | 1469 | captures 1470 | 1471 | 1 1472 | 1473 | name 1474 | punctuation.definition.link.markdown 1475 | 1476 | 2 1477 | 1478 | name 1479 | markup.underline.link.markdown 1480 | 1481 | 3 1482 | 1483 | name 1484 | punctuation.definition.link.markdown 1485 | 1486 | 1487 | match 1488 | (<)((?:https?|ftp)://.*?)(>) 1489 | name 1490 | meta.link.inet.markdown 1491 | 1492 | 1493 | link-inline 1494 | 1495 | captures 1496 | 1497 | 1 1498 | 1499 | name 1500 | punctuation.definition.string.begin.markdown 1501 | 1502 | 10 1503 | 1504 | name 1505 | string.other.link.description.title.markdown 1506 | 1507 | 11 1508 | 1509 | name 1510 | punctuation.definition.string.begin.markdown 1511 | 1512 | 12 1513 | 1514 | name 1515 | punctuation.definition.string.end.markdown 1516 | 1517 | 13 1518 | 1519 | name 1520 | string.other.link.description.title.markdown 1521 | 1522 | 14 1523 | 1524 | name 1525 | punctuation.definition.string.begin.markdown 1526 | 1527 | 15 1528 | 1529 | name 1530 | punctuation.definition.string.end.markdown 1531 | 1532 | 16 1533 | 1534 | name 1535 | punctuation.definition.metadata.markdown 1536 | 1537 | 2 1538 | 1539 | name 1540 | string.other.link.title.markdown 1541 | 1542 | 4 1543 | 1544 | name 1545 | punctuation.definition.string.end.markdown 1546 | 1547 | 5 1548 | 1549 | name 1550 | invalid.illegal.whitespace.markdown 1551 | 1552 | 6 1553 | 1554 | name 1555 | punctuation.definition.metadata.markdown 1556 | 1557 | 7 1558 | 1559 | name 1560 | punctuation.definition.link.markdown 1561 | 1562 | 8 1563 | 1564 | name 1565 | markup.underline.link.markdown 1566 | 1567 | 9 1568 | 1569 | name 1570 | punctuation.definition.link.markdown 1571 | 1572 | 1573 | match 1574 | (?x: 1575 | (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) 1576 | # Match the link text. 1577 | ([ ])? # Space not allowed 1578 | (\() # Opening paren for url 1579 | (<?)(.*?)(>?) # The url 1580 | [ \t]* # Optional whitespace 1581 | (?: 1582 | ((\().+?(\))) # Match title in parens… 1583 | | ((").+?(")) # or in quotes. 1584 | )? # Title is optional 1585 | \s* # Optional whitespace 1586 | (\)) 1587 | ) 1588 | name 1589 | meta.link.inline.markdown 1590 | 1591 | 1592 | link-ref 1593 | 1594 | captures 1595 | 1596 | 1 1597 | 1598 | name 1599 | punctuation.definition.string.begin.markdown 1600 | 1601 | 2 1602 | 1603 | name 1604 | string.other.link.title.markdown 1605 | 1606 | 4 1607 | 1608 | name 1609 | punctuation.definition.string.end.markdown 1610 | 1611 | 5 1612 | 1613 | name 1614 | punctuation.definition.constant.begin.markdown 1615 | 1616 | 6 1617 | 1618 | name 1619 | constant.other.reference.link.markdown 1620 | 1621 | 7 1622 | 1623 | name 1624 | punctuation.definition.constant.end.markdown 1625 | 1626 | 1627 | match 1628 | (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)([^\]]*+)(\]) 1629 | name 1630 | meta.link.reference.markdown 1631 | 1632 | 1633 | link-ref-literal 1634 | 1635 | captures 1636 | 1637 | 1 1638 | 1639 | name 1640 | punctuation.definition.string.begin.markdown 1641 | 1642 | 2 1643 | 1644 | name 1645 | string.other.link.title.markdown 1646 | 1647 | 4 1648 | 1649 | name 1650 | punctuation.definition.string.end.markdown 1651 | 1652 | 5 1653 | 1654 | name 1655 | punctuation.definition.constant.begin.markdown 1656 | 1657 | 6 1658 | 1659 | name 1660 | punctuation.definition.constant.end.markdown 1661 | 1662 | 1663 | match 1664 | (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(\]) 1665 | name 1666 | meta.link.reference.literal.markdown 1667 | 1668 | 1669 | list-paragraph 1670 | 1671 | patterns 1672 | 1673 | 1674 | begin 1675 | \G\s+(?=\S) 1676 | end 1677 | ^\s*$ 1678 | name 1679 | meta.paragraph.list.markdown 1680 | patterns 1681 | 1682 | 1683 | match 1684 | ^[ ]{0,3}([*+-])(?=\s) 1685 | name 1686 | punctuation.definition.list_item.markdown 1687 | 1688 | 1689 | match 1690 | ^[ ]{0,3}([0-9]+)(\.)(?=\s) 1691 | captures 1692 | 1693 | 1 1694 | 1695 | name 1696 | punctuation.definition.list_item.markdown punctuation.definition.list_item.number.markdown 1697 | 1698 | 2 1699 | 1700 | name 1701 | punctuation.definition.list_item.markdown 1702 | 1703 | 1704 | 1705 | 1706 | 1707 | include 1708 | #inline 1709 | 1710 | 1711 | 1712 | 1713 | 1714 | 1715 | raw 1716 | 1717 | captures 1718 | 1719 | 1 1720 | 1721 | name 1722 | punctuation.definition.raw.markdown 1723 | 1724 | 3 1725 | 1726 | name 1727 | punctuation.definition.raw.markdown 1728 | 1729 | 1730 | match 1731 | (`+)([^`]|(?!(?<!`)\1(?!`))`)*+(\1) 1732 | name 1733 | markup.raw.inline.markdown 1734 | 1735 | 1736 | separator 1737 | 1738 | match 1739 | \G[ ]{,3}([-*_])([ ]{,2}\1){2,}[ \t]*$\n? 1740 | name 1741 | meta.separator.markdown 1742 | 1743 | 1744 | bold 1745 | 1746 | begin 1747 | (?x) 1748 | (?:^|\s|\G)(\*\*|__)(?=\S) # Open 1749 | (?= 1750 | ( 1751 | <[^>]*+> # HTML tags 1752 | | (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> 1753 | # Raw 1754 | | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes 1755 | | \[ 1756 | ( 1757 | (?<square> # Named group 1758 | [^\[\]\\] # Match most chars 1759 | | \\. # Escaped chars 1760 | | \[ \g<square>*+ \] # Nested brackets 1761 | )*+ 1762 | \] 1763 | ( 1764 | ( # Reference Link 1765 | [ ]? # Optional space 1766 | \[[^\]]*+\] # Ref name 1767 | ) 1768 | | ( # Inline Link 1769 | \( # Opening paren 1770 | [ \t]*+ # Optional whtiespace 1771 | <?(.*?)>? # URL 1772 | [ \t]*+ # Optional whtiespace 1773 | ( # Optional Title 1774 | (?<title>['"]) 1775 | (.*?) 1776 | \k<title> 1777 | )? 1778 | \) 1779 | ) 1780 | ) 1781 | ) 1782 | | (?!(?<=\S)\1). # Everything besides 1783 | # style closer 1784 | )++ 1785 | (?<=\S)\1 # Close 1786 | ) 1787 | 1788 | captures 1789 | 1790 | 1 1791 | 1792 | name 1793 | punctuation.definition.bold.markdown 1794 | 1795 | 1796 | end 1797 | (?<=\S)(\1) 1798 | name 1799 | markup.bold.markdown 1800 | patterns 1801 | 1802 | 1803 | applyEndPatternLast 1804 | 1 1805 | begin 1806 | (?=<[^>]*?>) 1807 | end 1808 | (?<=>) 1809 | patterns 1810 | 1811 | 1812 | include 1813 | text.html.basic 1814 | 1815 | 1816 | 1817 | 1818 | include 1819 | #escape 1820 | 1821 | 1822 | include 1823 | #ampersand 1824 | 1825 | 1826 | include 1827 | #bracket 1828 | 1829 | 1830 | include 1831 | #raw 1832 | 1833 | 1834 | include 1835 | #italic 1836 | 1837 | 1838 | include 1839 | #image-inline 1840 | 1841 | 1842 | include 1843 | #link-inline 1844 | 1845 | 1846 | include 1847 | #link-inet 1848 | 1849 | 1850 | include 1851 | #link-email 1852 | 1853 | 1854 | include 1855 | #image-ref 1856 | 1857 | 1858 | include 1859 | #link-ref-literal 1860 | 1861 | 1862 | include 1863 | #link-ref 1864 | 1865 | 1866 | 1867 | 1868 | plain-uri 1869 | 1870 | match 1871 | (?xi) 1872 | \b 1873 | ( # Capture 1: entire matched URL 1874 | (?: 1875 | [a-z][\w-]+: # URL protocol and colon 1876 | (?: 1877 | /{1,3} # 1-3 slashes 1878 | | # or 1879 | [a-z0-9%] # Single letter or digit or '%' 1880 | # (Trying not to match e.g. "URI::Escape") 1881 | ) 1882 | | # or 1883 | www\d{0,3}[.] # "www.", "www1.", "www2." … "www999." 1884 | | # or 1885 | [a-z0-9.\-]+[.][a-z]{2,4}/ # looks like domain name followed by a slash 1886 | ) 1887 | (?: # One or more: 1888 | [^\s()<>]+ # Run of non-space, non-()<> 1889 | | # or 1890 | \(([^\s()<>]+|(\([^\s()<>]+\)))*\) # balanced parens, up to 2 levels 1891 | )+ 1892 | (?: # End with: 1893 | \(([^\s()<>]+|(\([^\s()<>]+\)))*\) # balanced parens, up to 2 levels 1894 | | # or 1895 | [^\s`!()\[\]{};:'".,<>?«»“”‘’] # not a space or one of these punct chars 1896 | ) 1897 | ) 1898 | name 1899 | markup.underline.link 1900 | 1901 | 1902 | scopeName 1903 | text.html.markdown 1904 | uuid 1905 | 0A1D9875-B448-11D9-BD50-000D93B6E43C 1906 | 1907 | 1908 | --------------------------------------------------------------------------------