1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883
|
# Github Favor Markdown Typeface
# https://github.github.com/gfm
# 6.4 Emphasis and strong emphasis
# Rule 1 {{{1
# A single * character can open emphasis iff (if and only if) it is part of a left-flanking delimiter run.'
#################
Given vimwiki (Typeface: https://github.github.com/gfm/#example-360):
*foo bar*
Execute (Log rule):
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Italic'
AssertEqual 'VimwikiItalic', SyntaxAt(1, 2)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-361):
a * foo bar*
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'This is not emphasis, because the opening * is followed by whitespace, and hence not part of a left-flanking delimiter'
AssertEqual '', SyntaxAt(1, 5)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-362):
todo TODO
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'TODO'
AssertEqual '', SyntaxAt(1, 5)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-363):
* a *
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Unicode nonbreaking spaces count as whitespace, too'
AssertEqual '', SyntaxAt(1, 3)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-364):
foo*bar*
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Intraword emphasis with * is permitted:'
AssertEqual 'VimwikiItalic', SyntaxAt(1, 5)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-365):
5*6*78
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
AssertEqual 'VimwikiItalic', SyntaxAt(1, 3)
# Rule 2 {{{1
# A single _ character can open emphasis iff it is part of a left-flanking delimiter run and either (a) not part of a right-flanking delimiter run or (b) part of a right-flanking delimiter run preceded by punctuation.
#################
Given vimwiki (Typeface: https://github.github.com/gfm/#example-366):
_foo bar_
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Italic'
AssertEqual 'VimwikiItalic', SyntaxAt(1, 3)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-367):
_ foo bar_
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'This is not emphasis, because the opening _ is followed by whitespace'
AssertEqual '', SyntaxAt(1, 3)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-368):
a_"foo"_
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Italic'
AssertEqual '', SyntaxAt(1, 4)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-369):
foo_bar_
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Emphasis with _ is not allowed inside words'
AssertEqual '', SyntaxAt(1, 5)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-370):
* 5_6_78
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
AssertEqual '', SyntaxAt(1, 3)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-371):
CommentLine 'Not emphasis in middle even if unicode alphanumeric before left delimiter'
пристаням_стремятся_
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
AssertEqual '', SyntaxAt(1, 22)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-372):
* aa_"bb"_cc
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Here _ does not generate emphasis, because the first delimiter run is right-flanking and the second left-flanking'
AssertEqual '', SyntaxAt(1, 5)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-373):
foo-_(bar)_
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'This is emphasis, even though the opening delimiter is both left- and right-flanking, because it is preceded by punctuation'
AssertEqual 'VimwikiItalic', SyntaxAt(1, 7)
# Rule 3 {{{1
# A single * character can close emphasis iff it is part of a right-flanking delimiter run.
Given vimwiki (Typeface: https://github.github.com/gfm/#example-374):
_foo*
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'This is not emphasis, in theory (1), IDEA change that'
Log 'But Vim reion implementation is highlitghing it anyway, it would be nice to change that'
Log 'Note: The decision to start a region is only based on a matching start pattern. There is no check for a matching end pattern.'
AssertEqual 'VimwikiItalic', SyntaxAt(1, 3)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-375):
*foo bar *
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'This is not emphasis, in theory (2), IDEA change that'
AssertEqual 'VimwikiItalic', SyntaxAt(1, 3)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-376):
*foo bar
*
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'This is not emphasis, in theory (2), IDEA change that'
AssertEqual 'VimwikiItalic', SyntaxAt(1, 3)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-377):
*(*foo)
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'This is not emphasis, because the second * is preceded by punctuation and followed by an alphanumeric (hence it is not part of a right-flanking delimiter, in theory, IDEA Change that'
AssertEqual 'VimwikiItalic', SyntaxAt(1, 2)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-378):
*(*foo*)*
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'The point of this restriction is more easily appreciated with this example, IDEA Change that'
AssertEqual 'VimwikiItalic', SyntaxAt(1, 2)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-379):
*foo*bar
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Intraword emphasis with * is allowed'
AssertEqual 'VimwikiItalic', SyntaxAt(1, 3)
# Rule 4 {{{1
# A single _ character can close emphasis iff it is part of a right-flanking delimiter run and either (a) not part of a left-flanking delimiter run or (b) part of a left-flanking delimiter run followed by punctuation.
# Rule 5 {{{1
# A double ** can open strong emphasis iff it is part of a left-flanking delimiter run.
Given vimwiki (Typeface: https://github.github.com/gfm/#example-387):
**foo bar**
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Easy bold'
AssertEqual 'VimwikiBold', SyntaxAt(1, 3)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-388):
** foo bar**
12345
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'This is not strong emphasis, because the opening delimiter is followed by whitespace'
AssertEqual '', SyntaxAt(1, 5)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-389):
a**"foo"**
123456
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'This is not strong emphasis, because the opening ** is preceded by an alphanumeric and followed by punctuation, and hence not part of a left-flanking delimiter'
AssertEqual '', SyntaxAt(1, 5)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-390):
foo**bar**
1234567890
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Intraword strong emphasis with ** is permitted'
AssertEqual 'VimwikiBold', SyntaxAt(1, 7)
AssertEqual '', SyntaxAt(2, 7)
# Rule 6 {{{1
# A double __ can open strong emphasis iff it is part of a left-flanking delimiter run and either (a) not part of a right-flanking delimiter run or (b) part of a right-flanking delimiter run preceded by punctuation.
Given vimwiki (Typeface: https://github.github.com/gfm/#example-391):
__foo bar__
1234567890
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Bold with __'
AssertEqual 'VimwikiBold', SyntaxAt(1, 4)
AssertEqual '', SyntaxAt(2, 7)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-392):
__ foo bar__
1234567890
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'This is not strong emphasis, because the opening delimiter is followed by whitespace'
AssertEqual '', SyntaxAt(1, 4)
AssertEqual '', SyntaxAt(2, 7)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-393):
__
foo bar__
1234567890
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'A newline counts as whitespace'
AssertEqual '', SyntaxAt(2, 4)
AssertEqual '', SyntaxAt(3, 7)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-394):
a__"foo"__
1234567890
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'This is not strong emphasis, because the opening __ is preceded by an alphanumeric and followed by punctuation'
AssertEqual '', SyntaxAt(1, 6)
AssertEqual '', SyntaxAt(2, 7)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-395):
foo__bar__
1234567890
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Intraword strong emphasis is forbidden with __'
AssertEqual '', SyntaxAt(1, 7)
AssertEqual '', SyntaxAt(2, 7)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-395):
5__6__78
1234567890
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Intraword strong emphasis is forbidden with __ (2)'
AssertEqual '', SyntaxAt(1, 4)
AssertEqual '', SyntaxAt(2, 7)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-397):
пристаням__стремятся__
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Intraword strong emphasis is forbidden with __ (3)'
AssertEqual '', SyntaxAt(1, 13)
AssertEqual '', SyntaxAt(2, 7)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-398):
__foo, __bar__, baz__
1234567890
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
AssertEqual 'VimwikiBold', SyntaxAt(1, 4)
AssertEqual '', SyntaxAt(2, 7)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-399):
foo-__(bar)__
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'This is strong emphasis, even though the opening delimiter is both left- and right-flanking, because it is preceded by punctuation'
AssertEqual 'VimwikiBold', SyntaxAt(1, 9)
AssertEqual '', SyntaxAt(2, 7)
# Rule 7 {{{1
# A double ** can close strong emphasis iff it is part of a right-flanking delimiter run.
Given vimwiki (Typeface: https://github.github.com/gfm/#example-400):
**foo bar **
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Rule 7: Passed: IDEA improve that'
AssertEqual 0, 0
# Rule 8 {{{1
# A double __ can close strong emphasis iff it is part of a right-flanking delimiter run and either (a) not part of a left-flanking delimiter run or (b) part of a left-flanking delimiter run followed by punctuation.
Given vimwiki (Typeface: https://github.github.com/gfm/#example-406):
__foo bar __
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Rule 8: Passed: IDEA improve that'
AssertEqual 0, 0
# Rule 9 {{{1
# Emphasis begins with a delimiter that can open emphasis and ends with a delimiter that can close emphasis, and that uses the same character (_ or *) as the opening delimiter. The opening and closing delimiters must belong to separate delimiter runs. If one of the delimiters can both open and close emphasis, then the sum of the lengths of the delimiter runs containing the opening and closing delimiters must not be a multiple of 3 unless both lengths are multiples of 3.
Given vimwiki (Typeface: https://github.github.com/gfm/#example-413):
*foo [bar](/url)*
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Any nonempty sequence of inline elements can be the contents of an emphasized span'
AssertEqual 'VimwikiItalic', SyntaxAt(1, 9)
AssertEqual '', SyntaxAt(2, 7)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-414):
*foo
bar*
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Any nonempty sequence of inline elements can be the contents of an emphasized span (2)'
AssertEqual 'VimwikiItalic', SyntaxAt(1, 3)
AssertEqual 'VimwikiItalic', SyntaxAt(2, 3)
AssertEqual '', SyntaxAt(3, 7)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-415):
_foo __bar__ baz_
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'In particular, emphasis and strong emphasis can be nested inside emphasis'
AssertEqual 'VimwikiItalic', SyntaxAt(1, 3)
AssertEqual 'VimwikiItalicBold', SyntaxAt(1, 9)
AssertEqual 'VimwikiItalic', SyntaxAt(1, 14)
AssertEqual '', SyntaxAt(2, 7)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-416):
_foo _bar_ baz_
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'TODO not implemented nested Italic, as the close of one region closes the other'
AssertEqual 0, 0
Given vimwiki (Typeface: https://github.github.com/gfm/#example-425):
foo***bar***baz
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Italic Bold'
AssertEqual 'VimwikiBoldItalic', SyntaxAt(1, 8)
AssertEqual '', SyntaxAt(2, 7)
# Rule 10 {{{1
# Strong emphasis begins with a delimiter that can open strong emphasis and ends with a delimiter that can close strong emphasis, and that uses the same character (_ or *) as the opening delimiter. The opening and closing delimiters must belong to separate delimiter runs. If one of the delimiters can both open and close strong emphasis, then the sum of the lengths of the delimiter runs containing the opening and closing delimiters must not be a multiple of 3 unless both lengths are multiples of 3.
Given vimwiki (Typeface: https://github.github.com/gfm/#example-431):
**foo [bar](/url)**
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Any nonempty sequence of inline elements can be the contents of an strongly emphasized span'
AssertEqual 'VimwikiBold', SyntaxAt(1, 8)
AssertEqual '', SyntaxAt(2, 7)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-432):
**foo
bar**
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
AssertEqual 'VimwikiBold', SyntaxAt(1, 3)
AssertEqual 'VimwikiBold', SyntaxAt(2, 3)
AssertEqual '', SyntaxAt(3, 7)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-433):
__foo _bar_ baz__
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'In particular, emphasis and strong emphasis can be nested inside strong emphasis'
AssertEqual 'VimwikiBold', SyntaxAt(1, 4)
AssertEqual 'VimwikiBoldItalic', SyntaxAt(1, 9)
AssertEqual 'VimwikiBold', SyntaxAt(1, 14)
AssertEqual '', SyntaxAt(2, 7)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-434):
__foo __bar__ baz__
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'TODO passed as nested bold is hard'
AssertEqual 0, 0
Given vimwiki (Typeface: https://github.github.com/gfm/#example-437):
**foo *bar* baz**
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Same as 433 but with *'
AssertEqual 'VimwikiBold', SyntaxAt(1, 4)
AssertEqual 'VimwikiBoldItalic', SyntaxAt(1, 9)
AssertEqual 'VimwikiBold', SyntaxAt(1, 14)
AssertEqual '', SyntaxAt(2, 7)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-443):
__ is not an empty emphasis
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'There can be no empty emphasis or strong emphasis:'
AssertEqual '', SyntaxAt(1, 4)
AssertEqual '', SyntaxAt(2, 7)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-444):
____ is not an empty strong emphasis
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'TODO: There can be no empty emphasis or strong emphasis (2)'
AssertEqual 0, 0
# Rule 11 {{{1
# A literal * character cannot occur at the beginning or end of *-delimited emphasis or **-delimited strong emphasis, unless it is backslash-escaped.
Given vimwiki (Typeface: https://github.github.com/gfm/#example-445):
foo ***
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Empty emphasis'
AssertEqual '1', SyntaxAt(1, 1) . 1
AssertEqual '2', SyntaxAt(2, 1) . 2
Given vimwiki (Typeface: https://github.github.com/gfm/#example-446):
foo *\**
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Emphasis an escaped *'
AssertEqual '', SyntaxAt(1, 1)
AssertEqual 'VimwikiItalic', SyntaxAt(1, 7)
AssertEqual '', SyntaxAt(2, 1)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-447):
foo *_*
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Emphasis a lonely _'
Log 'TODO, this is bold italic for now as we got it as special case'
AssertEqual 0, 0
# AssertEqual 'VimwikiItalic', SyntaxAt(1, 6)
# AssertEqual '', SyntaxAt(2, 1)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-448):
foo *****
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Nothing happen'
let var = SyntaxAt(1, 7)
AssertEqual 1, var == '' || var == 'VimwikiDelimiter'
AssertEqual '', SyntaxAt(2, 1)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-449):
foo **\***
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Emphasis a lonely *'
AssertEqual 'VimwikiBold', SyntaxAt(1, 8)
AssertEqual '', SyntaxAt(2, 1)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-450):
foo **_**
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'TODO'
AssertEqual 0, 0
# CommentLine 'Bold a single _ between **'
# AssertEqual 'VimwikiBold', SyntaxAt(1, 7)
# AssertEqual '', SyntaxAt(2, 1)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-451):
**foo*
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'IDEA: the rest is for haskell or yacc more than vim'
AssertEqual 0, 0
# AssertEqual '', SyntaxAt(2, 1)
# Rule 12 {{{1
# A literal _ character cannot occur at the beginning or end of _-delimited emphasis or __-delimited strong emphasis, unless it is backslash-escaped.
# Rule 13 {{{1
# The number of nestings should be minimized. Thus, for example, an interpretation <strong>...</strong> is always preferred to <em><em>...</em></em>.
Given vimwiki (Typeface: https://github.github.com/gfm/#example-469):
**foo**
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Basic bold'
AssertEqual 'VimwikiBold', SyntaxAt(1, 4)
AssertEqual '', SyntaxAt(2, 1)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-470):
*_foo_*
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'TODO Change that'
AssertEqual 0, 0
# CommentLine 'Double italic'
# AssertEqual 'VimwikiItalic', SyntaxAt(1, 4)
# AssertEqual '', SyntaxAt(2, 1)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-471):
__foo__
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Basic bold (2)'
AssertEqual 'VimwikiBold', SyntaxAt(1, 4)
AssertEqual '', SyntaxAt(2, 1)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-472):
_*foo*_
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Double italic (2)'
AssertEqual 'VimwikiItalic', SyntaxAt(1, 4)
AssertEqual '', SyntaxAt(2, 4)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-473):
****foo****
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Double bold with ****'
AssertEqual 'VimwikiBold', SyntaxAt(1, 6)
AssertEqual '', SyntaxAt(2, 1)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-474):
____foo____
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Double bold with ____'
AssertEqual 'VimwikiBold', SyntaxAt(1, 6)
AssertEqual '', SyntaxAt(2, 1)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-475):
******foo******
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Triple bold with ******'
AssertEqual 'VimwikiBold', SyntaxAt(1, 8)
AssertEqual '', SyntaxAt(2, 1)
# Rule 14 {{{1
# An interpretation <em><strong>...</strong></em> is always preferred to <strong><em>...</em></strong>.
Given vimwiki (Typeface: https://github.github.com/gfm/#example-476):
***foo***
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Bold Italic normal, with 3 *'
AssertEqual 'VimwikiBoldItalic', SyntaxAt(1, 5)
AssertEqual '', SyntaxAt(2, 1)
Given vimwiki (Typeface: https://github.github.com/gfm/#example-477):
_____foo_____
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'Bold Italic with 5 _'
CommentLine 'TODO Passed'
# AssertEqual 'VimwikiBoldItalic', SyntaxAt(1, 7)
# AssertEqual '', SyntaxAt(2, 1)
# Rule 15 {{{1
# When two potential emphasis or strong emphasis spans overlap, so that the second begins before the first ends and ends after the first ends, the first takes precedence. Thus, for example, *foo _bar* baz_ is parsed as <em>foo _bar</em> baz_ rather than *foo <em>bar* baz</em>.
# Rule 16 {{{1
# When there are two potential emphasis or strong emphasis spans with the same closing delimiter, the shorter one (the one that opens later) takes precedence. Thus, for example, **foo **bar baz** is parsed as **foo <strong>bar baz</strong> rather than <strong>foo **bar baz</strong>.
Given vimwiki (Typeface: https://github.github.com/gfm/#example-480):
**foo **bar baz**
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'All bold as the ** inside is not closing, Passed as vimwiki do not follow the spec'
AssertEqual 0, 0
# CommentLine 'Double bold (2)'
# AssertEqual 'VimwikiBold', SyntaxAt(1, 6)
# AssertEqual '', SyntaxAt(2, 1)
# Rule 17 {{{1
# Inline code spans, links, images, and HTML tags group more tightly than emphasis. So, when there is a choice between an interpretation that contains one of these elements and one that does not, the former always wins. Thus, for example, *[foo*](bar) is parsed as *<a href="bar">foo*</a> rather than as <em>[foo</em>](bar).
Given vimwiki (Typeface: https://github.github.com/gfm/#example-485):
*a `*` b*
*a `a a*a a` b*
12345678901234
Execute (Set Markdown):
call SetSyntax('markdown')
Execute (Assert Syntax):
CommentLine 'TODO with a * as unique code, a nice trap'
AssertEqual 0, 0
# vim: foldmethod=marker foldlevel=30 sw=2
|