├── .travis.yml ├── LICENSE.txt ├── Preferences └── TM_MARKDOWN.tmPreferences ├── README.md ├── Snippets └── Code block.tmSnippet ├── Support └── bin │ └── redcarpet.rb ├── Syntaxes ├── Markdown (GitHub Italics).tmLanguage └── Markdown (GitHub).tmLanguage ├── Tests └── Italics.mdown └── info.plist /.travis.yml: -------------------------------------------------------------------------------- 1 | script: 2 | - xmllint --valid *.plist */*.tm* >/dev/null 3 | - ruby -c */*/*.rb 4 | addons: 5 | apt: 6 | packages: 7 | # Needed for `xmllint`. 8 | - libxml2-utils -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2015 by Mike McQuaid 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Preferences/TM_MARKDOWN.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | TM_MARKDOWN 7 | settings 8 | 9 | shellVariables 10 | 11 | 12 | name 13 | TM_MARKDOWN 14 | value 15 | eval '${TM_BUNDLE_SUPPORT/'/'\''/g}/bin/redcarpet.rb' 16 | 17 | 18 | 19 | uuid 20 | 1DC6BEA7-C742-45CE-92D7-8F69D914DC93 21 | 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GitHub-Markdown.tmbundle 2 | Provides some [GitHub Flavoured Markdown](https://help.github.com/articles/github-flavored-markdown/) extensions for TextMate to make working with GitHub Flavoured Markdown nicer. 3 | 4 | ## Features 5 | - Add a new "Preview" command (overriding the existing Markdown preview) using [Redcarpet](https://github.com/vmg/redcarpet) to render GitHub Flavoured Markdown 6 | - Support triple-backtick raw blocks and support syntax highlighting for various languages (others can be added trivially). There’s also a tab trigger for inserting raw blocks: Just type a single backtick (`) and then hit the tab key. 7 | - Support and highlight GitHub Flavoured Markdown strikethroughs, tables, references, checkboxes and italics 8 | 9 | You can also use nicer fonts by installing the [GitHub Flavoured Markdown Font Settings bundle](https://github.com/mikemcquaid/GitHub-Markdown-Font-Settings.tmbundle). 10 | 11 | ## Installation 12 | 13 | Check "Markdown (GitHub)" in TextMate 2's Preferences' Bundles. 14 | 15 | Alternatively: 16 | ```bash 17 | mkdir -p ~/Library/Application\ Support/TextMate/Bundles 18 | cd ~/Library/Application\ Support/TextMate/Bundles 19 | git clone https://github.com/mikemcquaid/GitHub-Markdown.tmbundle 20 | ``` 21 | 22 | ## Status 23 | The above features are tested and working for my day-to-day. 24 | 25 | Tested using TextMate 2. May work in TextMate 1 or Sublime Text; I've no idea. 26 | 27 | [Patches welcome](https://github.com/mikemcquaid/GitHub-Markdown.tmbundle/pulls). 28 | 29 | ## Maintainers 30 | Currently maintained by [@noniq](https://github.com/noniq), originally created and maintained by [@MikeMcQuaid](https://github.com/MikeMcQuaid) 31 | 32 | ## License 33 | GitHub-Markdown.tmbundle is licensed under the [MIT License](http://en.wikipedia.org/wiki/MIT_License). The full license text is 34 | available in 35 | [LICENSE.txt](https://github.com/mikemcquaid/GitHub-Markdown.tmbundle/blob/master/LICENSE.txt). 36 | -------------------------------------------------------------------------------- /Snippets/Code block.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | \`\`\`${1|ada,adb,ads,antlr,applescript,bash,bib,c,c#,c++,cmake,cpp,csharp,css,dot,fish,g4,go,groovy,grt,gtpl,gv,gvy,haskell,hs,html,inc,java,javascript,jruby,js,json,latex,lua,macruby,make,Makefile,Markdown,matlab,md,node,ocaml,octave,perl,php,pl,prolog,py,python,r,R,rake,rb,rbx,ruby,rusthon,scpt,sh,shell,sparql,sql,swift,tcl,Tcl,tex,vhd,vhdl,VHDL,xhtml,yaml,yml,zsh|} 7 | $0 8 | \`\` 9 | name 10 | Insert Code Block 11 | scope 12 | text.html.markdown 13 | tabTrigger 14 | ` 15 | uuid 16 | 801405C3-C14D-4C1D-8353-AF6A54FED3D8 17 | 18 | 19 | -------------------------------------------------------------------------------- /Support/bin/redcarpet.rb: -------------------------------------------------------------------------------- 1 | #!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby 2 | # Usage: markdown-github.rb [...] 3 | # Convert one or more GitHub Flavored Markdown files to HTML and print to 4 | # standard output. With no or when is "-", read GitHub Flavored 5 | # Markdown source text from standard input. 6 | 7 | if ARGV.include?("--help") 8 | File.read(__FILE__).split("\n").grep(/^# /).each do |line| 9 | puts line[2..-1] 10 | end 11 | exit 0 12 | end 13 | 14 | require "rubygems" 15 | 16 | begin 17 | require "redcarpet" 18 | require "pygments" 19 | rescue LoadError 20 | puts <<-EOS 21 |

Please install the Redcarpet and Pygments.rb RubyGems by running the following:

22 | 23 |
/usr/bin/gem install --user redcarpet pygments.rb
24 | EOS 25 | exit 0 26 | end 27 | 28 | class PygmentsSmartyHTML < Redcarpet::Render::HTML 29 | include Redcarpet::Render::SmartyPants 30 | 31 | def block_code(code, language) 32 | language ||= "text" 33 | Pygments.highlight(code, :lexer => language) 34 | rescue 35 | Pygments.highlight(code, :lexer => "text") 36 | end 37 | end 38 | 39 | def checkbox_html(checked) 40 | "
  • " 41 | end 42 | 43 | def markdown(text) 44 | options = { 45 | :filter_html => true, 46 | :safe_links_only => true, 47 | :with_toc_data => true, 48 | :hard_wrap => true, 49 | } 50 | renderer = PygmentsSmartyHTML.new(options) 51 | extensions = { 52 | :no_intra_emphasis => true, 53 | :tables => true, 54 | :fenced_code_blocks => true, 55 | :autolink => true, 56 | :strikethrough => true, 57 | :space_after_headers => true, 58 | } 59 | html = Redcarpet::Markdown.new(renderer, extensions).render(text) 60 | html.gsub!("
  • [ ]", checkbox_html(false)) 61 | html.gsub!("
  • [x]", checkbox_html(true)) 62 | html 63 | end 64 | 65 | puts "" 66 | puts markdown(ARGF.read) 67 | -------------------------------------------------------------------------------- /Syntaxes/Markdown (GitHub Italics).tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | hideFromUser 8 | 9 | injectionSelector 10 | L:(text.html.markdown - (markup.italic.markdown | markup.bold.markdown | markup.raw)) 11 | name 12 | Markdown (GitHub Italics) 13 | patterns 14 | 15 | 16 | captures 17 | 18 | 1 19 | 20 | name 21 | punctuation.definition.italic.markdown.github 22 | 23 | 24 | comment 25 | This rule matches underscores inside words to avoid italicizing partial words 26 | (the grammar gets injected into the main Markdown grammar, so its rules have higher 27 | precedence and thus prevent the main Markdown grammar’s pattern for italic text from 28 | matching these underscores.) 29 | match 30 | (?<=\w)(_)(?=\w) 31 | name 32 | markup.other 33 | 34 | 35 | scopeName 36 | text.html.markdown.github 37 | uuid 38 | 8CD0FA72-F70B-446E-9B6B-A79FC90639EE 39 | 40 | 41 | -------------------------------------------------------------------------------- /Syntaxes/Markdown (GitHub).tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | hideFromUser 8 | 9 | injectionSelector 10 | text.html.markdown $, text.html.markdown meta.paragraph.markdown $ 11 | name 12 | Markdown (GitHub) 13 | patterns 14 | 15 | 16 | begin 17 | (^|\G)\s*([`~]{3,})\s*(ad[abs])\s*$ 18 | beginCaptures 19 | 20 | 2 21 | 22 | name 23 | punctuation.definition.raw.begin.markdown 24 | 25 | 3 26 | 27 | name 28 | storage.type.language.markdown 29 | 30 | 31 | contentName 32 | source.ada 33 | end 34 | (^|\G)\s*(\2)\n? 35 | endCaptures 36 | 37 | 2 38 | 39 | name 40 | punctuation.definition.raw.end.markdown 41 | 42 | 43 | name 44 | markup.raw.block.ada 45 | patterns 46 | 47 | 48 | include 49 | source.ada 50 | 51 | 52 | 53 | 54 | begin 55 | (^|\G)\s*([`~]{3,})\s*(antlr|g4)\s*$ 56 | beginCaptures 57 | 58 | 2 59 | 60 | name 61 | punctuation.definition.raw.begin.markdown 62 | 63 | 3 64 | 65 | name 66 | storage.type.language.markdown 67 | 68 | 69 | contentName 70 | source.antlr 71 | end 72 | (^|\G)\s*(\2)\n? 73 | endCaptures 74 | 75 | 2 76 | 77 | name 78 | punctuation.definition.raw.end.markdown 79 | 80 | 81 | name 82 | markup.raw.block.antlr 83 | patterns 84 | 85 | 86 | include 87 | source.antlr 88 | 89 | 90 | 91 | 92 | begin 93 | (^|\G)\s*([`~]{3,})\s*(applescript|scpt)\s*$ 94 | beginCaptures 95 | 96 | 2 97 | 98 | name 99 | punctuation.definition.raw.begin.markdown 100 | 101 | 3 102 | 103 | name 104 | storage.type.language.markdown 105 | 106 | 107 | contentName 108 | source.applescript 109 | end 110 | (^|\G)\s*(\2)\n? 111 | endCaptures 112 | 113 | 2 114 | 115 | name 116 | punctuation.definition.raw.end.markdown 117 | 118 | 119 | name 120 | markup.raw.block.applescript 121 | patterns 122 | 123 | 124 | include 125 | source.applescript 126 | 127 | 128 | 129 | 130 | begin 131 | (^|\G)\s*([`~]{3,})\s*(bib)\s*$ 132 | beginCaptures 133 | 134 | 2 135 | 136 | name 137 | punctuation.definition.raw.begin.markdown 138 | 139 | 3 140 | 141 | name 142 | storage.type.language.markdown 143 | 144 | 145 | contentName 146 | text.bibtex 147 | end 148 | (^|\G)\s*(\2)\n? 149 | endCaptures 150 | 151 | 2 152 | 153 | name 154 | punctuation.definition.raw.end.markdown 155 | 156 | 157 | name 158 | markup.raw.block.bibtex 159 | patterns 160 | 161 | 162 | include 163 | text.bibtex 164 | 165 | 166 | 167 | 168 | begin 169 | (^|\G)\s*([`~]{3,})\s*(cmake)\s*$ 170 | beginCaptures 171 | 172 | 2 173 | 174 | name 175 | punctuation.definition.raw.begin.markdown 176 | 177 | 3 178 | 179 | name 180 | storage.type.language.markdown 181 | 182 | 183 | contentName 184 | source.cmake 185 | end 186 | (^|\G)\s*(\2)\n? 187 | endCaptures 188 | 189 | 2 190 | 191 | name 192 | punctuation.definition.raw.end.markdown 193 | 194 | 195 | name 196 | markup.raw.block.cmake 197 | patterns 198 | 199 | 200 | include 201 | source.cmake 202 | 203 | 204 | 205 | 206 | begin 207 | (^|\G)\s*([`~]{3,})\s*(coffee)\s*$ 208 | beginCaptures 209 | 210 | 2 211 | 212 | name 213 | punctuation.definition.raw.begin.markdown 214 | 215 | 3 216 | 217 | name 218 | storage.type.language.markdown 219 | 220 | 221 | contentName 222 | source.coffee 223 | end 224 | (^|\G)\s*(\2)\n? 225 | endCaptures 226 | 227 | 2 228 | 229 | name 230 | punctuation.definition.raw.end.markdown 231 | 232 | 233 | name 234 | markup.raw.block.coffee 235 | patterns 236 | 237 | 238 | include 239 | source.coffee 240 | 241 | 242 | 243 | 244 | begin 245 | (^|\G)\s*([`~]{3,})\s*(dot|gv)\s*$ 246 | beginCaptures 247 | 248 | 2 249 | 250 | name 251 | punctuation.definition.raw.begin.markdown 252 | 253 | 3 254 | 255 | name 256 | storage.type.language.markdown 257 | 258 | 259 | contentName 260 | source.dot 261 | end 262 | (^|\G)\s*(\2)\n? 263 | endCaptures 264 | 265 | 2 266 | 267 | name 268 | punctuation.definition.raw.end.markdown 269 | 270 | 271 | name 272 | markup.raw.block.dot 273 | patterns 274 | 275 | 276 | include 277 | source.dot 278 | 279 | 280 | 281 | 282 | begin 283 | (^|\G)\s*([`~]{3,})\s*(fish)\s*$ 284 | beginCaptures 285 | 286 | 2 287 | 288 | name 289 | punctuation.definition.raw.begin.markdown 290 | 291 | 3 292 | 293 | name 294 | storage.type.language.markdown 295 | 296 | 297 | contentName 298 | source.fish 299 | end 300 | (^|\G)\s*(\2)\n? 301 | endCaptures 302 | 303 | 2 304 | 305 | name 306 | punctuation.definition.raw.end.markdown 307 | 308 | 309 | name 310 | markup.raw.block.fish 311 | patterns 312 | 313 | 314 | include 315 | source.fish 316 | 317 | 318 | 319 | 320 | begin 321 | (^|\G)\s*([`~]{3,})\s*(groovy|grt|gtpl|gvy)\s*$ 322 | beginCaptures 323 | 324 | 2 325 | 326 | name 327 | punctuation.definition.raw.begin.markdown 328 | 329 | 3 330 | 331 | name 332 | storage.type.language.markdown 333 | 334 | 335 | contentName 336 | source.groovy 337 | end 338 | (^|\G)\s*(\2)\n? 339 | endCaptures 340 | 341 | 2 342 | 343 | name 344 | punctuation.definition.raw.end.markdown 345 | 346 | 347 | name 348 | markup.raw.block.groovy 349 | patterns 350 | 351 | 352 | include 353 | source.groovy 354 | 355 | 356 | 357 | 358 | begin 359 | (^|\G)\s*([`~]{3,})\s*(hs|haskell)\s*$ 360 | beginCaptures 361 | 362 | 2 363 | 364 | name 365 | punctuation.definition.raw.begin.markdown 366 | 367 | 3 368 | 369 | name 370 | storage.type.language.markdown 371 | 372 | 373 | contentName 374 | source.haskell 375 | end 376 | (^|\G)\s*(\2)\n? 377 | endCaptures 378 | 379 | 2 380 | 381 | name 382 | punctuation.definition.raw.end.markdown 383 | 384 | 385 | name 386 | markup.raw.block.haskell 387 | patterns 388 | 389 | 390 | include 391 | source.haskell 392 | 393 | 394 | 395 | 396 | begin 397 | (^|\G)\s*([`~]{3,})\s*(javascript|js|node)\s*$ 398 | beginCaptures 399 | 400 | 2 401 | 402 | name 403 | punctuation.definition.raw.begin.markdown 404 | 405 | 3 406 | 407 | name 408 | storage.type.language.markdown 409 | 410 | 411 | contentName 412 | source.js 413 | end 414 | (^|\G)\s*(\2)\n? 415 | endCaptures 416 | 417 | 2 418 | 419 | name 420 | punctuation.definition.raw.end.markdown 421 | 422 | 423 | name 424 | markup.raw.block.js 425 | patterns 426 | 427 | 428 | include 429 | source.js 430 | 431 | 432 | 433 | 434 | begin 435 | (^|\G)\s*([`~]{3,})\s*(java)\s*$ 436 | beginCaptures 437 | 438 | 2 439 | 440 | name 441 | punctuation.definition.raw.begin.markdown 442 | 443 | 3 444 | 445 | name 446 | storage.type.language.markdown 447 | 448 | 449 | contentName 450 | source.java 451 | end 452 | (^|\G)\s*(\2)\n? 453 | endCaptures 454 | 455 | 2 456 | 457 | name 458 | punctuation.definition.raw.end.markdown 459 | 460 | 461 | name 462 | markup.raw.block.java 463 | patterns 464 | 465 | 466 | include 467 | source.java 468 | 469 | 470 | 471 | 472 | begin 473 | (^|\G)\s*([`~]{3,})\s*(json)\s*$ 474 | beginCaptures 475 | 476 | 2 477 | 478 | name 479 | punctuation.definition.raw.begin.markdown 480 | 481 | 3 482 | 483 | name 484 | storage.type.language.markdown 485 | 486 | 487 | contentName 488 | source.json 489 | end 490 | (^|\G)\s*(\2)\n? 491 | endCaptures 492 | 493 | 2 494 | 495 | name 496 | punctuation.definition.raw.end.markdown 497 | 498 | 499 | name 500 | markup.raw.block.json 501 | patterns 502 | 503 | 504 | include 505 | source.json 506 | 507 | 508 | 509 | 510 | begin 511 | (^|\G)\s*([`~]{3,})\s*(latex|tex)\s*$ 512 | beginCaptures 513 | 514 | 2 515 | 516 | name 517 | punctuation.definition.raw.begin.markdown 518 | 519 | 3 520 | 521 | name 522 | storage.type.language.markdown 523 | 524 | 525 | contentName 526 | text.tex.latex 527 | end 528 | (^|\G)\s*(\2)\n? 529 | endCaptures 530 | 531 | 2 532 | 533 | name 534 | punctuation.definition.raw.end.markdown 535 | 536 | 537 | name 538 | markup.raw.block.latex 539 | patterns 540 | 541 | 542 | include 543 | text.tex.latex 544 | 545 | 546 | 547 | 548 | begin 549 | (^|\G)\s*([`~]{3,})\s*(lua)\s*$ 550 | beginCaptures 551 | 552 | 2 553 | 554 | name 555 | punctuation.definition.raw.begin.markdown 556 | 557 | 3 558 | 559 | name 560 | storage.type.language.markdown 561 | 562 | 563 | contentName 564 | source.lua 565 | end 566 | (^|\G)\s*(\2)\n? 567 | endCaptures 568 | 569 | 2 570 | 571 | name 572 | punctuation.definition.raw.end.markdown 573 | 574 | 575 | name 576 | markup.raw.block.lua 577 | patterns 578 | 579 | 580 | include 581 | source.lua 582 | 583 | 584 | 585 | 586 | begin 587 | (^|\G)\s*([`~]{3,})\s*(make|Makefile)\s*$ 588 | beginCaptures 589 | 590 | 2 591 | 592 | name 593 | punctuation.definition.raw.begin.markdown 594 | 595 | 3 596 | 597 | name 598 | storage.type.language.markdown 599 | 600 | 601 | contentName 602 | source.makefile 603 | end 604 | (^|\G)\s*(\2)\n? 605 | endCaptures 606 | 607 | 2 608 | 609 | name 610 | punctuation.definition.raw.end.markdown 611 | 612 | 613 | name 614 | markup.raw.block.makefile 615 | patterns 616 | 617 | 618 | include 619 | source.makefile 620 | 621 | 622 | 623 | 624 | begin 625 | (^|\G)\s*([`~]{3,})\s*(md|Markdown)\s*$ 626 | beginCaptures 627 | 628 | 2 629 | 630 | name 631 | punctuation.definition.raw.begin.markdown 632 | 633 | 3 634 | 635 | name 636 | storage.type.language.markdown 637 | 638 | 639 | contentName 640 | text.html.markdown 641 | end 642 | (^|\G)\s*(\2)\n? 643 | endCaptures 644 | 645 | 2 646 | 647 | name 648 | punctuation.definition.raw.end.markdown 649 | 650 | 651 | name 652 | markup.raw.block.markdown 653 | patterns 654 | 655 | 656 | include 657 | text.html.markdown 658 | 659 | 660 | 661 | 662 | begin 663 | (^|\G)\s*([`~]{3,})\s*(matlab)\s*$ 664 | beginCaptures 665 | 666 | 2 667 | 668 | name 669 | punctuation.definition.raw.begin.markdown 670 | 671 | 3 672 | 673 | name 674 | storage.type.language.markdown 675 | 676 | 677 | contentName 678 | source.matlab 679 | end 680 | (^|\G)\s*(\2)\n? 681 | endCaptures 682 | 683 | 2 684 | 685 | name 686 | punctuation.definition.raw.end.markdown 687 | 688 | 689 | name 690 | markup.raw.block.matlab 691 | patterns 692 | 693 | 694 | include 695 | source.matlab 696 | 697 | 698 | 699 | 700 | begin 701 | (^|\G)\s*([`~]{3,})\s*(octave)\s*$ 702 | beginCaptures 703 | 704 | 2 705 | 706 | name 707 | punctuation.definition.raw.begin.markdown 708 | 709 | 3 710 | 711 | name 712 | storage.type.language.markdown 713 | 714 | 715 | contentName 716 | source.octave 717 | end 718 | (^|\G)\s*(\2)\n? 719 | endCaptures 720 | 721 | 2 722 | 723 | name 724 | punctuation.definition.raw.end.markdown 725 | 726 | 727 | name 728 | markup.raw.block.octave 729 | patterns 730 | 731 | 732 | include 733 | source.octave 734 | 735 | 736 | 737 | 738 | begin 739 | (^|\G)\s*([`~]{3,})\s*(ocaml)\s*$ 740 | beginCaptures 741 | 742 | 2 743 | 744 | name 745 | punctuation.definition.raw.begin.markdown 746 | 747 | 3 748 | 749 | name 750 | storage.type.language.markdown 751 | 752 | 753 | contentName 754 | source.ocaml 755 | end 756 | (^|\G)\s*(\2)\n? 757 | endCaptures 758 | 759 | 2 760 | 761 | name 762 | punctuation.definition.raw.end.markdown 763 | 764 | 765 | name 766 | markup.raw.block.ocaml 767 | patterns 768 | 769 | 770 | include 771 | source.ocaml 772 | 773 | 774 | 775 | 776 | begin 777 | (^|\G)\s*([`~]{3,})\s*(perl|pl)\s*$ 778 | beginCaptures 779 | 780 | 2 781 | 782 | name 783 | punctuation.definition.raw.begin.markdown 784 | 785 | 3 786 | 787 | name 788 | storage.type.language.markdown 789 | 790 | 791 | contentName 792 | source.perl 793 | end 794 | (^|\G)\s*(\2)\n? 795 | endCaptures 796 | 797 | 2 798 | 799 | name 800 | punctuation.definition.raw.end.markdown 801 | 802 | 803 | name 804 | markup.raw.block.perl 805 | patterns 806 | 807 | 808 | include 809 | source.perl 810 | 811 | 812 | 813 | 814 | begin 815 | (^|\G)\s*([`~]{3,})\s*(prolog)\s*$ 816 | beginCaptures 817 | 818 | 2 819 | 820 | name 821 | punctuation.definition.raw.begin.markdown 822 | 823 | 3 824 | 825 | name 826 | storage.type.language.markdown 827 | 828 | 829 | contentName 830 | source.prolog 831 | end 832 | (^|\G)\s*(\2)\n? 833 | endCaptures 834 | 835 | 2 836 | 837 | name 838 | punctuation.definition.raw.end.markdown 839 | 840 | 841 | name 842 | markup.raw.block.prolog 843 | patterns 844 | 845 | 846 | include 847 | source.prolog 848 | 849 | 850 | 851 | 852 | begin 853 | (^|\G)\s*([`~]{3,})\s*([Rr])\s*$ 854 | beginCaptures 855 | 856 | 2 857 | 858 | name 859 | punctuation.definition.raw.begin.markdown 860 | 861 | 3 862 | 863 | name 864 | storage.type.language.markdown 865 | 866 | 867 | contentName 868 | source.r 869 | end 870 | (^|\G)\s*(\2)\n? 871 | endCaptures 872 | 873 | 2 874 | 875 | name 876 | punctuation.definition.raw.end.markdown 877 | 878 | 879 | name 880 | markup.raw.block.r 881 | patterns 882 | 883 | 884 | include 885 | source.r 886 | 887 | 888 | 889 | 890 | begin 891 | (^|\G)\s*([`~]{3,})\s*(ruby|jruby|macruby|rake|rb|rbx)\s*$ 892 | beginCaptures 893 | 894 | 2 895 | 896 | name 897 | punctuation.definition.raw.begin.markdown 898 | 899 | 3 900 | 901 | name 902 | storage.type.language.markdown 903 | 904 | 905 | contentName 906 | source.ruby 907 | end 908 | (^|\G)\s*(\2)\n? 909 | endCaptures 910 | 911 | 2 912 | 913 | name 914 | punctuation.definition.raw.end.markdown 915 | 916 | 917 | name 918 | markup.raw.block.ruby 919 | patterns 920 | 921 | 922 | include 923 | source.ruby 924 | 925 | 926 | 927 | 928 | begin 929 | (^|\G)\s*([`~]{3,})\s*(sass)\s*$ 930 | beginCaptures 931 | 932 | 2 933 | 934 | name 935 | punctuation.definition.raw.begin.markdown 936 | 937 | 3 938 | 939 | name 940 | storage.type.language.markdown 941 | 942 | 943 | contentName 944 | source.sass 945 | end 946 | (^|\G)\s*(\2)\n? 947 | endCaptures 948 | 949 | 2 950 | 951 | name 952 | punctuation.definition.raw.end.markdown 953 | 954 | 955 | name 956 | markup.raw.block.sass 957 | patterns 958 | 959 | 960 | include 961 | source.sass 962 | 963 | 964 | 965 | 966 | begin 967 | (^|\G)\s*([`~]{3,})\s*(php|inc)\s*$ 968 | beginCaptures 969 | 970 | 2 971 | 972 | name 973 | punctuation.definition.raw.begin.markdown 974 | 975 | 3 976 | 977 | name 978 | storage.type.language.markdown 979 | 980 | 981 | contentName 982 | text.html.php 983 | end 984 | (^|\G)\s*(\2)\n? 985 | endCaptures 986 | 987 | 2 988 | 989 | name 990 | punctuation.definition.raw.end.markdown 991 | 992 | 993 | name 994 | markup.raw.block.php 995 | patterns 996 | 997 | 998 | include 999 | text.html.php 1000 | 1001 | 1002 | 1003 | 1004 | begin 1005 | (^|\G)\s*([`~]{3,})\s*(py(?:thon)?|rusthon)\s*$ 1006 | beginCaptures 1007 | 1008 | 2 1009 | 1010 | name 1011 | punctuation.definition.raw.begin.markdown 1012 | 1013 | 3 1014 | 1015 | name 1016 | storage.type.language.markdown 1017 | 1018 | 1019 | contentName 1020 | source.python 1021 | end 1022 | (^|\G)\s*(\2)\n? 1023 | endCaptures 1024 | 1025 | 2 1026 | 1027 | name 1028 | punctuation.definition.raw.end.markdown 1029 | 1030 | 1031 | name 1032 | markup.raw.block.python 1033 | patterns 1034 | 1035 | 1036 | include 1037 | source.python 1038 | 1039 | 1040 | 1041 | 1042 | begin 1043 | (^|\G)\s*([`~]{3,})\s*(css)\s*$ 1044 | beginCaptures 1045 | 1046 | 2 1047 | 1048 | name 1049 | punctuation.definition.raw.begin.markdown 1050 | 1051 | 3 1052 | 1053 | name 1054 | storage.type.language.markdown 1055 | 1056 | 1057 | contentName 1058 | source.css 1059 | end 1060 | (^|\G)\s*(\2)\n? 1061 | endCaptures 1062 | 1063 | 2 1064 | 1065 | name 1066 | punctuation.definition.raw.end.markdown 1067 | 1068 | 1069 | name 1070 | markup.raw.block.css 1071 | patterns 1072 | 1073 | 1074 | include 1075 | source.css 1076 | 1077 | 1078 | 1079 | 1080 | begin 1081 | (^|\G)\s*([`~]{3,})\s*(c\+\+|cpp)\s*$ 1082 | beginCaptures 1083 | 1084 | 2 1085 | 1086 | name 1087 | punctuation.definition.raw.begin.markdown 1088 | 1089 | 3 1090 | 1091 | name 1092 | storage.type.language.markdown 1093 | 1094 | 1095 | contentName 1096 | source.c++ 1097 | end 1098 | (^|\G)\s*(\2)\n? 1099 | endCaptures 1100 | 1101 | 2 1102 | 1103 | name 1104 | punctuation.definition.raw.end.markdown 1105 | 1106 | 1107 | name 1108 | markup.raw.block.c++ 1109 | patterns 1110 | 1111 | 1112 | include 1113 | source.c++ 1114 | 1115 | 1116 | 1117 | 1118 | begin 1119 | (^|\G)\s*([`~]{3,})\s*(c#|csharp)\s*$ 1120 | beginCaptures 1121 | 1122 | 2 1123 | 1124 | name 1125 | punctuation.definition.raw.begin.markdown 1126 | 1127 | 3 1128 | 1129 | name 1130 | storage.type.language.markdown 1131 | 1132 | 1133 | contentName 1134 | source.cs 1135 | end 1136 | (^|\G)\s*(\2)\n? 1137 | endCaptures 1138 | 1139 | 2 1140 | 1141 | name 1142 | punctuation.definition.raw.end.markdown 1143 | 1144 | 1145 | name 1146 | markup.raw.block.cs 1147 | patterns 1148 | 1149 | 1150 | include 1151 | source.cs 1152 | 1153 | 1154 | 1155 | 1156 | begin 1157 | (^|\G)\s*([`~]{3,})\s*(c)\s*$ 1158 | beginCaptures 1159 | 1160 | 2 1161 | 1162 | name 1163 | punctuation.definition.raw.begin.markdown 1164 | 1165 | 3 1166 | 1167 | name 1168 | storage.type.language.markdown 1169 | 1170 | 1171 | contentName 1172 | source.c 1173 | end 1174 | (^|\G)\s*(\2)\n? 1175 | endCaptures 1176 | 1177 | 2 1178 | 1179 | name 1180 | punctuation.definition.raw.end.markdown 1181 | 1182 | 1183 | name 1184 | markup.raw.block.c 1185 | patterns 1186 | 1187 | 1188 | include 1189 | source.c 1190 | 1191 | 1192 | 1193 | 1194 | begin 1195 | (^|\G)\s*([`~]{3,})\s*(html|xhtml)\s*$ 1196 | beginCaptures 1197 | 1198 | 2 1199 | 1200 | name 1201 | punctuation.definition.raw.begin.markdown 1202 | 1203 | 3 1204 | 1205 | name 1206 | storage.type.language.markdown 1207 | 1208 | 1209 | contentName 1210 | text.html.basic 1211 | end 1212 | (^|\G)\s*(\2)\n? 1213 | endCaptures 1214 | 1215 | 2 1216 | 1217 | name 1218 | punctuation.definition.raw.end.markdown 1219 | 1220 | 1221 | name 1222 | markup.raw.block.html 1223 | patterns 1224 | 1225 | 1226 | include 1227 | text.html.basic 1228 | 1229 | 1230 | 1231 | 1232 | begin 1233 | (^|\G)\s*([`~]{3,})\s*(shell|sh|bash|zsh)\s*$ 1234 | beginCaptures 1235 | 1236 | 2 1237 | 1238 | name 1239 | punctuation.definition.raw.begin.markdown 1240 | 1241 | 3 1242 | 1243 | name 1244 | storage.type.language.markdown 1245 | 1246 | 1247 | contentName 1248 | source.shell 1249 | end 1250 | (^|\G)\s*(\2)\n? 1251 | endCaptures 1252 | 1253 | 2 1254 | 1255 | name 1256 | punctuation.definition.raw.end.markdown 1257 | 1258 | 1259 | name 1260 | markup.raw.block.shell 1261 | patterns 1262 | 1263 | 1264 | include 1265 | source.shell 1266 | 1267 | 1268 | 1269 | 1270 | begin 1271 | (^|\G)\s*([`~]{3,})\s*(go)\s*$ 1272 | beginCaptures 1273 | 1274 | 2 1275 | 1276 | name 1277 | punctuation.definition.raw.begin.markdown 1278 | 1279 | 3 1280 | 1281 | name 1282 | storage.type.language.markdown 1283 | 1284 | 1285 | contentName 1286 | source.go 1287 | end 1288 | (^|\G)\s*(\2)\n? 1289 | endCaptures 1290 | 1291 | 2 1292 | 1293 | name 1294 | punctuation.definition.raw.end.markdown 1295 | 1296 | 1297 | name 1298 | markup.raw.block.go 1299 | patterns 1300 | 1301 | 1302 | include 1303 | source.go 1304 | 1305 | 1306 | 1307 | 1308 | begin 1309 | (^|\G)\s*([`~]{3,})\s*(sparql)\s*$ 1310 | beginCaptures 1311 | 1312 | 2 1313 | 1314 | name 1315 | punctuation.definition.raw.begin.markdown 1316 | 1317 | 3 1318 | 1319 | name 1320 | storage.type.language.markdown 1321 | 1322 | 1323 | contentName 1324 | source.sparql 1325 | end 1326 | (^|\G)\s*(\2)\n? 1327 | endCaptures 1328 | 1329 | 2 1330 | 1331 | name 1332 | punctuation.definition.raw.end.markdown 1333 | 1334 | 1335 | name 1336 | markup.raw.block.sparql 1337 | patterns 1338 | 1339 | 1340 | include 1341 | source.sparql 1342 | 1343 | 1344 | 1345 | 1346 | begin 1347 | (^|\G)\s*([`~]{3,})\s*(sql)\s*$ 1348 | beginCaptures 1349 | 1350 | 2 1351 | 1352 | name 1353 | punctuation.definition.raw.begin.markdown 1354 | 1355 | 3 1356 | 1357 | name 1358 | storage.type.language.markdown 1359 | 1360 | 1361 | contentName 1362 | source.sql 1363 | end 1364 | (^|\G)\s*(\2)\n? 1365 | endCaptures 1366 | 1367 | 2 1368 | 1369 | name 1370 | punctuation.definition.raw.end.markdown 1371 | 1372 | 1373 | name 1374 | markup.raw.block.sql 1375 | patterns 1376 | 1377 | 1378 | include 1379 | source.sql 1380 | 1381 | 1382 | 1383 | 1384 | begin 1385 | (^|\G)\s*([`~]{3,})\s*(swift)\s*$ 1386 | beginCaptures 1387 | 1388 | 2 1389 | 1390 | name 1391 | punctuation.definition.raw.begin.markdown 1392 | 1393 | 3 1394 | 1395 | name 1396 | storage.type.language.markdown 1397 | 1398 | 1399 | contentName 1400 | source.swift 1401 | end 1402 | (^|\G)\s*(\2)\n? 1403 | endCaptures 1404 | 1405 | 2 1406 | 1407 | name 1408 | punctuation.definition.raw.end.markdown 1409 | 1410 | 1411 | name 1412 | markup.raw.block.swift 1413 | patterns 1414 | 1415 | 1416 | include 1417 | source.swift 1418 | 1419 | 1420 | 1421 | 1422 | begin 1423 | (^|\G)\s*([`~]{3,})\s*([Tt]cl)\s*$ 1424 | beginCaptures 1425 | 1426 | 2 1427 | 1428 | name 1429 | punctuation.definition.raw.begin.markdown 1430 | 1431 | 3 1432 | 1433 | name 1434 | storage.type.language.markdown 1435 | 1436 | 1437 | contentName 1438 | source.tcl 1439 | end 1440 | (^|\G)\s*(\2)\n? 1441 | endCaptures 1442 | 1443 | 2 1444 | 1445 | name 1446 | punctuation.definition.raw.end.markdown 1447 | 1448 | 1449 | name 1450 | markup.raw.block.tcl 1451 | patterns 1452 | 1453 | 1454 | include 1455 | source.tcl 1456 | 1457 | 1458 | 1459 | 1460 | begin 1461 | (^|\G)\s*([`~]{3,})\s*(vhdl?|VHDL)\s*$ 1462 | beginCaptures 1463 | 1464 | 2 1465 | 1466 | name 1467 | punctuation.definition.raw.begin.markdown 1468 | 1469 | 3 1470 | 1471 | name 1472 | storage.type.language.markdown 1473 | 1474 | 1475 | contentName 1476 | source.vhdl 1477 | end 1478 | (^|\G)\s*(\2)\n? 1479 | endCaptures 1480 | 1481 | 2 1482 | 1483 | name 1484 | punctuation.definition.raw.end.markdown 1485 | 1486 | 1487 | name 1488 | markup.raw.block.vhdl 1489 | patterns 1490 | 1491 | 1492 | include 1493 | source.vhdl 1494 | 1495 | 1496 | 1497 | 1498 | begin 1499 | (^|\G)\s*([`~]{3,})\s*(ya?ml)\s*$ 1500 | beginCaptures 1501 | 1502 | 2 1503 | 1504 | name 1505 | punctuation.definition.raw.begin.markdown 1506 | 1507 | 3 1508 | 1509 | name 1510 | storage.type.language.markdown 1511 | 1512 | 1513 | contentName 1514 | source.yaml 1515 | end 1516 | (^|\G)\s*(\2)\n? 1517 | endCaptures 1518 | 1519 | 2 1520 | 1521 | name 1522 | punctuation.definition.raw.end.markdown 1523 | 1524 | 1525 | name 1526 | markup.raw.block.yaml 1527 | patterns 1528 | 1529 | 1530 | include 1531 | source.yaml 1532 | 1533 | 1534 | 1535 | 1536 | begin 1537 | (^|\G)\s*([`~]{3})\s*([\w-]*)\s*$ 1538 | beginCaptures 1539 | 1540 | 2 1541 | 1542 | name 1543 | punctuation.definition.raw.begin.markdown 1544 | 1545 | 1546 | end 1547 | (^|\G)\s*(\2)\n? 1548 | endCaptures 1549 | 1550 | 2 1551 | 1552 | name 1553 | punctuation.definition.raw.end.markdown 1554 | 1555 | 1556 | name 1557 | markup.raw.block 1558 | 1559 | 1560 | captures 1561 | 1562 | 1 1563 | 1564 | name 1565 | punctuation.definition.strikethrough.markdown.github 1566 | 1567 | 2 1568 | 1569 | name 1570 | string.other.strikethrough.markdown.github 1571 | 1572 | 3 1573 | 1574 | name 1575 | punctuation.definition.strikethrough.markdown.github 1576 | 1577 | 1578 | match 1579 | (~~)([^~]*)(~~) 1580 | name 1581 | markup.other.strikethrough.markdown.github 1582 | 1583 | 1584 | captures 1585 | 1586 | 1 1587 | 1588 | name 1589 | punctuation.definition.string.begin.markdown.github 1590 | 1591 | 2 1592 | 1593 | name 1594 | string.other.link.title.markdown.github 1595 | 1596 | 3 1597 | 1598 | name 1599 | punctuation.definition.string.begin.markdown.github 1600 | 1601 | 1602 | match 1603 | (\[)([^\]]*)(\]) 1604 | name 1605 | meta.link.reference.markdown.github 1606 | 1607 | 1608 | begin 1609 | (^|\G)(\|)(?=[^|]+\|) 1610 | captures 1611 | 1612 | 1 1613 | 1614 | name 1615 | punctuation.definition.table.markdown.github 1616 | 1617 | 1618 | end 1619 | (?<!\|)(^|\G)(?!\|) 1620 | name 1621 | markup.other.table.markdown.github 1622 | patterns 1623 | 1624 | 1625 | match 1626 | \| 1627 | name 1628 | punctuation.definition.table.markdown.github 1629 | 1630 | 1631 | captures 1632 | 1633 | 1 1634 | 1635 | name 1636 | punctuation.separator.header.markdown.github 1637 | 1638 | 1639 | match 1640 | (?<=\|)\s*(:?-+:?)\s*(?=\|) 1641 | 1642 | 1643 | captures 1644 | 1645 | 1 1646 | 1647 | name 1648 | string.other.table.markdown.github 1649 | patterns 1650 | 1651 | 1652 | include 1653 | text.html.markdown#inline 1654 | 1655 | 1656 | 1657 | 1658 | match 1659 | (?<=\|)\s*(?=\S)((\\\||[^|])+)(?<=\S)\s*(?=\|) 1660 | 1661 | 1662 | 1663 | 1664 | scopeName 1665 | text.html.markdown.github 1666 | uuid 1667 | C1028E0A-F9D7-4296-A681-2756A4657AAA 1668 | 1669 | 1670 | -------------------------------------------------------------------------------- /Tests/Italics.mdown: -------------------------------------------------------------------------------- 1 | # Should Match 2 | 3 | _italic_ 4 | 5 | _italic italic_ 6 | 7 | _italic_regular 8 | 9 | 10 | # Should Not Match 11 | 12 | regular_regular_regular 13 | 14 | 15 | # Should Not Match But Does 16 | 17 | regular _italic_regular 18 | 19 | 20 | # Other Cases (Should not match) 21 | 22 | __double underscores__ 23 | 24 | _raw_ 25 | 26 | raw_raw_raw 27 | 28 | Lorem `ipsum_dolor_sit` amet 29 | 30 | 31 | # Exceptional Cases 32 | 33 | $$y_i = \alpha_{j[i]} + \beta x_i + \epsilon_i$$ 34 | 35 | This is MathJax code which should be parsed separately, but shows just how loose the main spec is about what can be in italic. -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | contactEmailRot13 6 | zvxr@zvxrzpdhnvq.pbz 7 | contactName 8 | Mike McQuaid 9 | description 10 | GFM syntax highlighting and preview. 11 | name 12 | Markdown (GitHub) 13 | uuid 14 | A9CF0E77-E848-417C-90F4-77E1231FF1B9 15 | 16 | 17 | --------------------------------------------------------------------------------