Markdown parser fork with extended syntax for personal use.
at main 9166 lines 149 kB view raw
1//! `CommonMark` test suite. 2 3// > 👉 **Important**: this module is generated by `generate/src/main.rs`. 4// > It is generate from the latest CommonMark website. 5 6use markdown::{message, to_html_with_options, CompileOptions, Options}; 7use pretty_assertions::assert_eq; 8 9#[rustfmt::skip] 10#[test] 11fn commonmark() -> Result<(), message::Message> { 12 let danger = Options { 13 compile: CompileOptions { 14 allow_dangerous_html: true, 15 allow_dangerous_protocol: true, 16 ..CompileOptions::default() 17 }, 18 ..Options::default() 19 }; 20 21 assert_eq!( 22 to_html_with_options( 23 r###" foo baz bim 24"###, 25 &danger 26 )?, 27 r###"<pre><code>foo baz bim 28</code></pre> 29"###, 30 r###"Tabs (1)"### 31); 32 33 assert_eq!( 34 to_html_with_options( 35 r###" foo baz bim 36"###, 37 &danger 38 )?, 39 r###"<pre><code>foo baz bim 40</code></pre> 41"###, 42 r###"Tabs (2)"### 43); 44 45 assert_eq!( 46 to_html_with_options( 47 r###" a a 48 ὐ a 49"###, 50 &danger 51 )?, 52 r###"<pre><code>a a 53ὐ a 54</code></pre> 55"###, 56 r###"Tabs (3)"### 57); 58 59 assert_eq!( 60 to_html_with_options( 61 r###" - foo 62 63 bar 64"###, 65 &danger 66 )?, 67 r###"<ul> 68<li> 69<p>foo</p> 70<p>bar</p> 71</li> 72</ul> 73"###, 74 r###"Tabs (4)"### 75); 76 77 assert_eq!( 78 to_html_with_options( 79 r###"- foo 80 81 bar 82"###, 83 &danger 84 )?, 85 r###"<ul> 86<li> 87<p>foo</p> 88<pre><code> bar 89</code></pre> 90</li> 91</ul> 92"###, 93 r###"Tabs (5)"### 94); 95 96 assert_eq!( 97 to_html_with_options( 98 r###"> foo 99"###, 100 &danger 101 )?, 102 r###"<blockquote> 103<pre><code> foo 104</code></pre> 105</blockquote> 106"###, 107 r###"Tabs (6)"### 108); 109 110 assert_eq!( 111 to_html_with_options( 112 r###"- foo 113"###, 114 &danger 115 )?, 116 r###"<ul> 117<li> 118<pre><code> foo 119</code></pre> 120</li> 121</ul> 122"###, 123 r###"Tabs (7)"### 124); 125 126 assert_eq!( 127 to_html_with_options( 128 r###" foo 129 bar 130"###, 131 &danger 132 )?, 133 r###"<pre><code>foo 134bar 135</code></pre> 136"###, 137 r###"Tabs (8)"### 138); 139 140 assert_eq!( 141 to_html_with_options( 142 r###" - foo 143 - bar 144 - baz 145"###, 146 &danger 147 )?, 148 r###"<ul> 149<li>foo 150<ul> 151<li>bar 152<ul> 153<li>baz</li> 154</ul> 155</li> 156</ul> 157</li> 158</ul> 159"###, 160 r###"Tabs (9)"### 161); 162 163 assert_eq!( 164 to_html_with_options( 165 r###"# Foo 166"###, 167 &danger 168 )?, 169 r###"<h1>Foo</h1> 170"###, 171 r###"Tabs (10)"### 172); 173 174 assert_eq!( 175 to_html_with_options( 176 r###"* * * 177"###, 178 &danger 179 )?, 180 r###"<hr /> 181"###, 182 r###"Tabs (11)"### 183); 184 185 assert_eq!( 186 to_html_with_options( 187 r###"\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~ 188"###, 189 &danger 190 )?, 191 r###"<p>!&quot;#$%&amp;'()*+,-./:;&lt;=&gt;?@[\]^_`{|}~</p> 192"###, 193 r###"Backslash escapes (12)"### 194); 195 196 assert_eq!( 197 to_html_with_options( 198 r###"\ \A\a\ \3\φ\« 199"###, 200 &danger 201 )?, 202 r###"<p>\ \A\a\ \3\φ\«</p> 203"###, 204 r###"Backslash escapes (13)"### 205); 206 207 assert_eq!( 208 to_html_with_options( 209 r###"\*not emphasized* 210\<br/> not a tag 211\[not a link](/foo) 212\`not code` 2131\. not a list 214\* not a list 215\# not a heading 216\[foo]: /url "not a reference" 217\&ouml; not a character entity 218"###, 219 &danger 220 )?, 221 r###"<p>*not emphasized* 222&lt;br/&gt; not a tag 223[not a link](/foo) 224`not code` 2251. not a list 226* not a list 227# not a heading 228[foo]: /url &quot;not a reference&quot; 229&amp;ouml; not a character entity</p> 230"###, 231 r###"Backslash escapes (14)"### 232); 233 234 assert_eq!( 235 to_html_with_options( 236 r###"\\*emphasis* 237"###, 238 &danger 239 )?, 240 r###"<p>\<em>emphasis</em></p> 241"###, 242 r###"Backslash escapes (15)"### 243); 244 245 assert_eq!( 246 to_html_with_options( 247 r###"foo\ 248bar 249"###, 250 &danger 251 )?, 252 r###"<p>foo<br /> 253bar</p> 254"###, 255 r###"Backslash escapes (16)"### 256); 257 258 assert_eq!( 259 to_html_with_options( 260 r###"`` \[\` `` 261"###, 262 &danger 263 )?, 264 r###"<p><code>\[\`</code></p> 265"###, 266 r###"Backslash escapes (17)"### 267); 268 269 assert_eq!( 270 to_html_with_options( 271 r###" \[\] 272"###, 273 &danger 274 )?, 275 r###"<pre><code>\[\] 276</code></pre> 277"###, 278 r###"Backslash escapes (18)"### 279); 280 281 assert_eq!( 282 to_html_with_options( 283 r###"~~~ 284\[\] 285~~~ 286"###, 287 &danger 288 )?, 289 r###"<pre><code>\[\] 290</code></pre> 291"###, 292 r###"Backslash escapes (19)"### 293); 294 295 assert_eq!( 296 to_html_with_options( 297 r###"<https://example.com?find=\*> 298"###, 299 &danger 300 )?, 301 r###"<p><a href="https://example.com?find=%5C*">https://example.com?find=\*</a></p> 302"###, 303 r###"Backslash escapes (20)"### 304); 305 306 assert_eq!( 307 to_html_with_options( 308 r###"<a href="/bar\/)"> 309"###, 310 &danger 311 )?, 312 r###"<a href="/bar\/)"> 313"###, 314 r###"Backslash escapes (21)"### 315); 316 317 assert_eq!( 318 to_html_with_options( 319 r###"[foo](/bar\* "ti\*tle") 320"###, 321 &danger 322 )?, 323 r###"<p><a href="/bar*" title="ti*tle">foo</a></p> 324"###, 325 r###"Backslash escapes (22)"### 326); 327 328 assert_eq!( 329 to_html_with_options( 330 r###"[foo] 331 332[foo]: /bar\* "ti\*tle" 333"###, 334 &danger 335 )?, 336 r###"<p><a href="/bar*" title="ti*tle">foo</a></p> 337"###, 338 r###"Backslash escapes (23)"### 339); 340 341 assert_eq!( 342 to_html_with_options( 343 r###"``` foo\+bar 344foo 345``` 346"###, 347 &danger 348 )?, 349 r###"<pre><code class="language-foo+bar">foo 350</code></pre> 351"###, 352 r###"Backslash escapes (24)"### 353); 354 355 assert_eq!( 356 to_html_with_options( 357 r###"&nbsp; &amp; &copy; &AElig; &Dcaron; 358&frac34; &HilbertSpace; &DifferentialD; 359&ClockwiseContourIntegral; &ngE; 360"###, 361 &danger 362 )?, 363 r###"<p>  &amp; © Æ Ď 364¾ ℋ ⅆ 365∲ ≧̸</p> 366"###, 367 r###"Entity and numeric character references (25)"### 368); 369 370 assert_eq!( 371 to_html_with_options( 372 r###"&#35; &#1234; &#992; &#0; 373"###, 374 &danger 375 )?, 376 r###"<p># Ӓ Ϡ �</p> 377"###, 378 r###"Entity and numeric character references (26)"### 379); 380 381 assert_eq!( 382 to_html_with_options( 383 r###"&#X22; &#XD06; &#xcab; 384"###, 385 &danger 386 )?, 387 r###"<p>&quot; ആ ಫ</p> 388"###, 389 r###"Entity and numeric character references (27)"### 390); 391 392 assert_eq!( 393 to_html_with_options( 394 r###"&nbsp &x; &#; &#x; 395&#87654321; 396&#abcdef0; 397&ThisIsNotDefined; &hi?; 398"###, 399 &danger 400 )?, 401 r###"<p>&amp;nbsp &amp;x; &amp;#; &amp;#x; 402&amp;#87654321; 403&amp;#abcdef0; 404&amp;ThisIsNotDefined; &amp;hi?;</p> 405"###, 406 r###"Entity and numeric character references (28)"### 407); 408 409 assert_eq!( 410 to_html_with_options( 411 r###"&copy 412"###, 413 &danger 414 )?, 415 r###"<p>&amp;copy</p> 416"###, 417 r###"Entity and numeric character references (29)"### 418); 419 420 assert_eq!( 421 to_html_with_options( 422 r###"&MadeUpEntity; 423"###, 424 &danger 425 )?, 426 r###"<p>&amp;MadeUpEntity;</p> 427"###, 428 r###"Entity and numeric character references (30)"### 429); 430 431 assert_eq!( 432 to_html_with_options( 433 r###"<a href="&ouml;&ouml;.html"> 434"###, 435 &danger 436 )?, 437 r###"<a href="&ouml;&ouml;.html"> 438"###, 439 r###"Entity and numeric character references (31)"### 440); 441 442 assert_eq!( 443 to_html_with_options( 444 r###"[foo](/f&ouml;&ouml; "f&ouml;&ouml;") 445"###, 446 &danger 447 )?, 448 r###"<p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p> 449"###, 450 r###"Entity and numeric character references (32)"### 451); 452 453 assert_eq!( 454 to_html_with_options( 455 r###"[foo] 456 457[foo]: /f&ouml;&ouml; "f&ouml;&ouml;" 458"###, 459 &danger 460 )?, 461 r###"<p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p> 462"###, 463 r###"Entity and numeric character references (33)"### 464); 465 466 assert_eq!( 467 to_html_with_options( 468 r###"``` f&ouml;&ouml; 469foo 470``` 471"###, 472 &danger 473 )?, 474 r###"<pre><code class="language-föö">foo 475</code></pre> 476"###, 477 r###"Entity and numeric character references (34)"### 478); 479 480 assert_eq!( 481 to_html_with_options( 482 r###"`f&ouml;&ouml;` 483"###, 484 &danger 485 )?, 486 r###"<p><code>f&amp;ouml;&amp;ouml;</code></p> 487"###, 488 r###"Entity and numeric character references (35)"### 489); 490 491 assert_eq!( 492 to_html_with_options( 493 r###" f&ouml;f&ouml; 494"###, 495 &danger 496 )?, 497 r###"<pre><code>f&amp;ouml;f&amp;ouml; 498</code></pre> 499"###, 500 r###"Entity and numeric character references (36)"### 501); 502 503 assert_eq!( 504 to_html_with_options( 505 r###"&#42;foo&#42; 506*foo* 507"###, 508 &danger 509 )?, 510 r###"<p>*foo* 511<em>foo</em></p> 512"###, 513 r###"Entity and numeric character references (37)"### 514); 515 516 assert_eq!( 517 to_html_with_options( 518 r###"&#42; foo 519 520* foo 521"###, 522 &danger 523 )?, 524 r###"<p>* foo</p> 525<ul> 526<li>foo</li> 527</ul> 528"###, 529 r###"Entity and numeric character references (38)"### 530); 531 532 assert_eq!( 533 to_html_with_options( 534 r###"foo&#10;&#10;bar 535"###, 536 &danger 537 )?, 538 r###"<p>foo 539 540bar</p> 541"###, 542 r###"Entity and numeric character references (39)"### 543); 544 545 assert_eq!( 546 to_html_with_options( 547 r###"&#9;foo 548"###, 549 &danger 550 )?, 551 r###"<p> foo</p> 552"###, 553 r###"Entity and numeric character references (40)"### 554); 555 556 assert_eq!( 557 to_html_with_options( 558 r###"[a](url &quot;tit&quot;) 559"###, 560 &danger 561 )?, 562 r###"<p>[a](url &quot;tit&quot;)</p> 563"###, 564 r###"Entity and numeric character references (41)"### 565); 566 567 assert_eq!( 568 to_html_with_options( 569 r###"- `one 570- two` 571"###, 572 &danger 573 )?, 574 r###"<ul> 575<li>`one</li> 576<li>two`</li> 577</ul> 578"###, 579 r###"Precedence (42)"### 580); 581 582 assert_eq!( 583 to_html_with_options( 584 r###"*** 585--- 586___ 587"###, 588 &danger 589 )?, 590 r###"<hr /> 591<hr /> 592<hr /> 593"###, 594 r###"Thematic breaks (43)"### 595); 596 597 assert_eq!( 598 to_html_with_options( 599 r###"+++ 600"###, 601 &danger 602 )?, 603 r###"<p>+++</p> 604"###, 605 r###"Thematic breaks (44)"### 606); 607 608 assert_eq!( 609 to_html_with_options( 610 r###"=== 611"###, 612 &danger 613 )?, 614 r###"<p>===</p> 615"###, 616 r###"Thematic breaks (45)"### 617); 618 619 assert_eq!( 620 to_html_with_options( 621 r###"-- 622** 623__ 624"###, 625 &danger 626 )?, 627 r###"<p>-- 628** 629__</p> 630"###, 631 r###"Thematic breaks (46)"### 632); 633 634 assert_eq!( 635 to_html_with_options( 636 r###" *** 637 *** 638 *** 639"###, 640 &danger 641 )?, 642 r###"<hr /> 643<hr /> 644<hr /> 645"###, 646 r###"Thematic breaks (47)"### 647); 648 649 assert_eq!( 650 to_html_with_options( 651 r###" *** 652"###, 653 &danger 654 )?, 655 r###"<pre><code>*** 656</code></pre> 657"###, 658 r###"Thematic breaks (48)"### 659); 660 661 assert_eq!( 662 to_html_with_options( 663 r###"Foo 664 *** 665"###, 666 &danger 667 )?, 668 r###"<p>Foo 669***</p> 670"###, 671 r###"Thematic breaks (49)"### 672); 673 674 assert_eq!( 675 to_html_with_options( 676 r###"_____________________________________ 677"###, 678 &danger 679 )?, 680 r###"<hr /> 681"###, 682 r###"Thematic breaks (50)"### 683); 684 685 assert_eq!( 686 to_html_with_options( 687 r###" - - - 688"###, 689 &danger 690 )?, 691 r###"<hr /> 692"###, 693 r###"Thematic breaks (51)"### 694); 695 696 assert_eq!( 697 to_html_with_options( 698 r###" ** * ** * ** * ** 699"###, 700 &danger 701 )?, 702 r###"<hr /> 703"###, 704 r###"Thematic breaks (52)"### 705); 706 707 assert_eq!( 708 to_html_with_options( 709 r###"- - - - 710"###, 711 &danger 712 )?, 713 r###"<hr /> 714"###, 715 r###"Thematic breaks (53)"### 716); 717 718 assert_eq!( 719 to_html_with_options( 720 r###"- - - - 721"###, 722 &danger 723 )?, 724 r###"<hr /> 725"###, 726 r###"Thematic breaks (54)"### 727); 728 729 assert_eq!( 730 to_html_with_options( 731 r###"_ _ _ _ a 732 733a------ 734 735---a--- 736"###, 737 &danger 738 )?, 739 r###"<p>_ _ _ _ a</p> 740<p>a------</p> 741<p>---a---</p> 742"###, 743 r###"Thematic breaks (55)"### 744); 745 746 assert_eq!( 747 to_html_with_options( 748 r###" *-* 749"###, 750 &danger 751 )?, 752 r###"<p><em>-</em></p> 753"###, 754 r###"Thematic breaks (56)"### 755); 756 757 assert_eq!( 758 to_html_with_options( 759 r###"- foo 760*** 761- bar 762"###, 763 &danger 764 )?, 765 r###"<ul> 766<li>foo</li> 767</ul> 768<hr /> 769<ul> 770<li>bar</li> 771</ul> 772"###, 773 r###"Thematic breaks (57)"### 774); 775 776 assert_eq!( 777 to_html_with_options( 778 r###"Foo 779*** 780bar 781"###, 782 &danger 783 )?, 784 r###"<p>Foo</p> 785<hr /> 786<p>bar</p> 787"###, 788 r###"Thematic breaks (58)"### 789); 790 791 assert_eq!( 792 to_html_with_options( 793 r###"Foo 794--- 795bar 796"###, 797 &danger 798 )?, 799 r###"<h2>Foo</h2> 800<p>bar</p> 801"###, 802 r###"Thematic breaks (59)"### 803); 804 805 assert_eq!( 806 to_html_with_options( 807 r###"* Foo 808* * * 809* Bar 810"###, 811 &danger 812 )?, 813 r###"<ul> 814<li>Foo</li> 815</ul> 816<hr /> 817<ul> 818<li>Bar</li> 819</ul> 820"###, 821 r###"Thematic breaks (60)"### 822); 823 824 assert_eq!( 825 to_html_with_options( 826 r###"- Foo 827- * * * 828"###, 829 &danger 830 )?, 831 r###"<ul> 832<li>Foo</li> 833<li> 834<hr /> 835</li> 836</ul> 837"###, 838 r###"Thematic breaks (61)"### 839); 840 841 assert_eq!( 842 to_html_with_options( 843 r###"# foo 844## foo 845### foo 846#### foo 847##### foo 848###### foo 849"###, 850 &danger 851 )?, 852 r###"<h1>foo</h1> 853<h2>foo</h2> 854<h3>foo</h3> 855<h4>foo</h4> 856<h5>foo</h5> 857<h6>foo</h6> 858"###, 859 r###"ATX headings (62)"### 860); 861 862 assert_eq!( 863 to_html_with_options( 864 r###"####### foo 865"###, 866 &danger 867 )?, 868 r###"<p>####### foo</p> 869"###, 870 r###"ATX headings (63)"### 871); 872 873 assert_eq!( 874 to_html_with_options( 875 r###"#5 bolt 876 877#hashtag 878"###, 879 &danger 880 )?, 881 r###"<p>#5 bolt</p> 882<p>#hashtag</p> 883"###, 884 r###"ATX headings (64)"### 885); 886 887 assert_eq!( 888 to_html_with_options( 889 r###"\## foo 890"###, 891 &danger 892 )?, 893 r###"<p>## foo</p> 894"###, 895 r###"ATX headings (65)"### 896); 897 898 assert_eq!( 899 to_html_with_options( 900 r###"# foo *bar* \*baz\* 901"###, 902 &danger 903 )?, 904 r###"<h1>foo <em>bar</em> *baz*</h1> 905"###, 906 r###"ATX headings (66)"### 907); 908 909 assert_eq!( 910 to_html_with_options( 911 r###"# foo 912"###, 913 &danger 914 )?, 915 r###"<h1>foo</h1> 916"###, 917 r###"ATX headings (67)"### 918); 919 920 assert_eq!( 921 to_html_with_options( 922 r###" ### foo 923 ## foo 924 # foo 925"###, 926 &danger 927 )?, 928 r###"<h3>foo</h3> 929<h2>foo</h2> 930<h1>foo</h1> 931"###, 932 r###"ATX headings (68)"### 933); 934 935 assert_eq!( 936 to_html_with_options( 937 r###" # foo 938"###, 939 &danger 940 )?, 941 r###"<pre><code># foo 942</code></pre> 943"###, 944 r###"ATX headings (69)"### 945); 946 947 assert_eq!( 948 to_html_with_options( 949 r###"foo 950 # bar 951"###, 952 &danger 953 )?, 954 r###"<p>foo 955# bar</p> 956"###, 957 r###"ATX headings (70)"### 958); 959 960 assert_eq!( 961 to_html_with_options( 962 r###"## foo ## 963 ### bar ### 964"###, 965 &danger 966 )?, 967 r###"<h2>foo</h2> 968<h3>bar</h3> 969"###, 970 r###"ATX headings (71)"### 971); 972 973 assert_eq!( 974 to_html_with_options( 975 r###"# foo ################################## 976##### foo ## 977"###, 978 &danger 979 )?, 980 r###"<h1>foo</h1> 981<h5>foo</h5> 982"###, 983 r###"ATX headings (72)"### 984); 985 986 assert_eq!( 987 to_html_with_options( 988 r###"### foo ### 989"###, 990 &danger 991 )?, 992 r###"<h3>foo</h3> 993"###, 994 r###"ATX headings (73)"### 995); 996 997 assert_eq!( 998 to_html_with_options( 999 r###"### foo ### b 1000"###, 1001 &danger 1002 )?, 1003 r###"<h3>foo ### b</h3> 1004"###, 1005 r###"ATX headings (74)"### 1006); 1007 1008 assert_eq!( 1009 to_html_with_options( 1010 r###"# foo# 1011"###, 1012 &danger 1013 )?, 1014 r###"<h1>foo#</h1> 1015"###, 1016 r###"ATX headings (75)"### 1017); 1018 1019 assert_eq!( 1020 to_html_with_options( 1021 r###"### foo \### 1022## foo #\## 1023# foo \# 1024"###, 1025 &danger 1026 )?, 1027 r###"<h3>foo ###</h3> 1028<h2>foo ###</h2> 1029<h1>foo #</h1> 1030"###, 1031 r###"ATX headings (76)"### 1032); 1033 1034 assert_eq!( 1035 to_html_with_options( 1036 r###"**** 1037## foo 1038**** 1039"###, 1040 &danger 1041 )?, 1042 r###"<hr /> 1043<h2>foo</h2> 1044<hr /> 1045"###, 1046 r###"ATX headings (77)"### 1047); 1048 1049 assert_eq!( 1050 to_html_with_options( 1051 r###"Foo bar 1052# baz 1053Bar foo 1054"###, 1055 &danger 1056 )?, 1057 r###"<p>Foo bar</p> 1058<h1>baz</h1> 1059<p>Bar foo</p> 1060"###, 1061 r###"ATX headings (78)"### 1062); 1063 1064 assert_eq!( 1065 to_html_with_options( 1066 r###"## 1067# 1068### ### 1069"###, 1070 &danger 1071 )?, 1072 r###"<h2></h2> 1073<h1></h1> 1074<h3></h3> 1075"###, 1076 r###"ATX headings (79)"### 1077); 1078 1079 assert_eq!( 1080 to_html_with_options( 1081 r###"Foo *bar* 1082========= 1083 1084Foo *bar* 1085--------- 1086"###, 1087 &danger 1088 )?, 1089 r###"<h1>Foo <em>bar</em></h1> 1090<h2>Foo <em>bar</em></h2> 1091"###, 1092 r###"Setext headings (80)"### 1093); 1094 1095 assert_eq!( 1096 to_html_with_options( 1097 r###"Foo *bar 1098baz* 1099==== 1100"###, 1101 &danger 1102 )?, 1103 r###"<h1>Foo <em>bar 1104baz</em></h1> 1105"###, 1106 r###"Setext headings (81)"### 1107); 1108 1109 assert_eq!( 1110 to_html_with_options( 1111 r###" Foo *bar 1112baz* 1113==== 1114"###, 1115 &danger 1116 )?, 1117 r###"<h1>Foo <em>bar 1118baz</em></h1> 1119"###, 1120 r###"Setext headings (82)"### 1121); 1122 1123 assert_eq!( 1124 to_html_with_options( 1125 r###"Foo 1126------------------------- 1127 1128Foo 1129= 1130"###, 1131 &danger 1132 )?, 1133 r###"<h2>Foo</h2> 1134<h1>Foo</h1> 1135"###, 1136 r###"Setext headings (83)"### 1137); 1138 1139 assert_eq!( 1140 to_html_with_options( 1141 r###" Foo 1142--- 1143 1144 Foo 1145----- 1146 1147 Foo 1148 === 1149"###, 1150 &danger 1151 )?, 1152 r###"<h2>Foo</h2> 1153<h2>Foo</h2> 1154<h1>Foo</h1> 1155"###, 1156 r###"Setext headings (84)"### 1157); 1158 1159 assert_eq!( 1160 to_html_with_options( 1161 r###" Foo 1162 --- 1163 1164 Foo 1165--- 1166"###, 1167 &danger 1168 )?, 1169 r###"<pre><code>Foo 1170--- 1171 1172Foo 1173</code></pre> 1174<hr /> 1175"###, 1176 r###"Setext headings (85)"### 1177); 1178 1179 assert_eq!( 1180 to_html_with_options( 1181 r###"Foo 1182 ---- 1183"###, 1184 &danger 1185 )?, 1186 r###"<h2>Foo</h2> 1187"###, 1188 r###"Setext headings (86)"### 1189); 1190 1191 assert_eq!( 1192 to_html_with_options( 1193 r###"Foo 1194 --- 1195"###, 1196 &danger 1197 )?, 1198 r###"<p>Foo 1199---</p> 1200"###, 1201 r###"Setext headings (87)"### 1202); 1203 1204 assert_eq!( 1205 to_html_with_options( 1206 r###"Foo 1207= = 1208 1209Foo 1210--- - 1211"###, 1212 &danger 1213 )?, 1214 r###"<p>Foo 1215= =</p> 1216<p>Foo</p> 1217<hr /> 1218"###, 1219 r###"Setext headings (88)"### 1220); 1221 1222 assert_eq!( 1223 to_html_with_options( 1224 r###"Foo 1225----- 1226"###, 1227 &danger 1228 )?, 1229 r###"<h2>Foo</h2> 1230"###, 1231 r###"Setext headings (89)"### 1232); 1233 1234 assert_eq!( 1235 to_html_with_options( 1236 r###"Foo\ 1237---- 1238"###, 1239 &danger 1240 )?, 1241 r###"<h2>Foo\</h2> 1242"###, 1243 r###"Setext headings (90)"### 1244); 1245 1246 assert_eq!( 1247 to_html_with_options( 1248 r###"`Foo 1249---- 1250` 1251 1252<a title="a lot 1253--- 1254of dashes"/> 1255"###, 1256 &danger 1257 )?, 1258 r###"<h2>`Foo</h2> 1259<p>`</p> 1260<h2>&lt;a title=&quot;a lot</h2> 1261<p>of dashes&quot;/&gt;</p> 1262"###, 1263 r###"Setext headings (91)"### 1264); 1265 1266 assert_eq!( 1267 to_html_with_options( 1268 r###"> Foo 1269--- 1270"###, 1271 &danger 1272 )?, 1273 r###"<blockquote> 1274<p>Foo</p> 1275</blockquote> 1276<hr /> 1277"###, 1278 r###"Setext headings (92)"### 1279); 1280 1281 assert_eq!( 1282 to_html_with_options( 1283 r###"> foo 1284bar 1285=== 1286"###, 1287 &danger 1288 )?, 1289 r###"<blockquote> 1290<p>foo 1291bar 1292===</p> 1293</blockquote> 1294"###, 1295 r###"Setext headings (93)"### 1296); 1297 1298 assert_eq!( 1299 to_html_with_options( 1300 r###"- Foo 1301--- 1302"###, 1303 &danger 1304 )?, 1305 r###"<ul> 1306<li>Foo</li> 1307</ul> 1308<hr /> 1309"###, 1310 r###"Setext headings (94)"### 1311); 1312 1313 assert_eq!( 1314 to_html_with_options( 1315 r###"Foo 1316Bar 1317--- 1318"###, 1319 &danger 1320 )?, 1321 r###"<h2>Foo 1322Bar</h2> 1323"###, 1324 r###"Setext headings (95)"### 1325); 1326 1327 assert_eq!( 1328 to_html_with_options( 1329 r###"--- 1330Foo 1331--- 1332Bar 1333--- 1334Baz 1335"###, 1336 &danger 1337 )?, 1338 r###"<hr /> 1339<h2>Foo</h2> 1340<h2>Bar</h2> 1341<p>Baz</p> 1342"###, 1343 r###"Setext headings (96)"### 1344); 1345 1346 assert_eq!( 1347 to_html_with_options( 1348 r###" 1349==== 1350"###, 1351 &danger 1352 )?, 1353 r###"<p>====</p> 1354"###, 1355 r###"Setext headings (97)"### 1356); 1357 1358 assert_eq!( 1359 to_html_with_options( 1360 r###"--- 1361--- 1362"###, 1363 &danger 1364 )?, 1365 r###"<hr /> 1366<hr /> 1367"###, 1368 r###"Setext headings (98)"### 1369); 1370 1371 assert_eq!( 1372 to_html_with_options( 1373 r###"- foo 1374----- 1375"###, 1376 &danger 1377 )?, 1378 r###"<ul> 1379<li>foo</li> 1380</ul> 1381<hr /> 1382"###, 1383 r###"Setext headings (99)"### 1384); 1385 1386 assert_eq!( 1387 to_html_with_options( 1388 r###" foo 1389--- 1390"###, 1391 &danger 1392 )?, 1393 r###"<pre><code>foo 1394</code></pre> 1395<hr /> 1396"###, 1397 r###"Setext headings (100)"### 1398); 1399 1400 assert_eq!( 1401 to_html_with_options( 1402 r###"> foo 1403----- 1404"###, 1405 &danger 1406 )?, 1407 r###"<blockquote> 1408<p>foo</p> 1409</blockquote> 1410<hr /> 1411"###, 1412 r###"Setext headings (101)"### 1413); 1414 1415 assert_eq!( 1416 to_html_with_options( 1417 r###"\> foo 1418------ 1419"###, 1420 &danger 1421 )?, 1422 r###"<h2>&gt; foo</h2> 1423"###, 1424 r###"Setext headings (102)"### 1425); 1426 1427 assert_eq!( 1428 to_html_with_options( 1429 r###"Foo 1430 1431bar 1432--- 1433baz 1434"###, 1435 &danger 1436 )?, 1437 r###"<p>Foo</p> 1438<h2>bar</h2> 1439<p>baz</p> 1440"###, 1441 r###"Setext headings (103)"### 1442); 1443 1444 assert_eq!( 1445 to_html_with_options( 1446 r###"Foo 1447bar 1448 1449--- 1450 1451baz 1452"###, 1453 &danger 1454 )?, 1455 r###"<p>Foo 1456bar</p> 1457<hr /> 1458<p>baz</p> 1459"###, 1460 r###"Setext headings (104)"### 1461); 1462 1463 assert_eq!( 1464 to_html_with_options( 1465 r###"Foo 1466bar 1467* * * 1468baz 1469"###, 1470 &danger 1471 )?, 1472 r###"<p>Foo 1473bar</p> 1474<hr /> 1475<p>baz</p> 1476"###, 1477 r###"Setext headings (105)"### 1478); 1479 1480 assert_eq!( 1481 to_html_with_options( 1482 r###"Foo 1483bar 1484\--- 1485baz 1486"###, 1487 &danger 1488 )?, 1489 r###"<p>Foo 1490bar 1491--- 1492baz</p> 1493"###, 1494 r###"Setext headings (106)"### 1495); 1496 1497 assert_eq!( 1498 to_html_with_options( 1499 r###" a simple 1500 indented code block 1501"###, 1502 &danger 1503 )?, 1504 r###"<pre><code>a simple 1505 indented code block 1506</code></pre> 1507"###, 1508 r###"Indented code blocks (107)"### 1509); 1510 1511 assert_eq!( 1512 to_html_with_options( 1513 r###" - foo 1514 1515 bar 1516"###, 1517 &danger 1518 )?, 1519 r###"<ul> 1520<li> 1521<p>foo</p> 1522<p>bar</p> 1523</li> 1524</ul> 1525"###, 1526 r###"Indented code blocks (108)"### 1527); 1528 1529 assert_eq!( 1530 to_html_with_options( 1531 r###"1. foo 1532 1533 - bar 1534"###, 1535 &danger 1536 )?, 1537 r###"<ol> 1538<li> 1539<p>foo</p> 1540<ul> 1541<li>bar</li> 1542</ul> 1543</li> 1544</ol> 1545"###, 1546 r###"Indented code blocks (109)"### 1547); 1548 1549 assert_eq!( 1550 to_html_with_options( 1551 r###" <a/> 1552 *hi* 1553 1554 - one 1555"###, 1556 &danger 1557 )?, 1558 r###"<pre><code>&lt;a/&gt; 1559*hi* 1560 1561- one 1562</code></pre> 1563"###, 1564 r###"Indented code blocks (110)"### 1565); 1566 1567 assert_eq!( 1568 to_html_with_options( 1569 r###" chunk1 1570 1571 chunk2 1572 1573 1574 1575 chunk3 1576"###, 1577 &danger 1578 )?, 1579 r###"<pre><code>chunk1 1580 1581chunk2 1582 1583 1584 1585chunk3 1586</code></pre> 1587"###, 1588 r###"Indented code blocks (111)"### 1589); 1590 1591 assert_eq!( 1592 to_html_with_options( 1593 r###" chunk1 1594 1595 chunk2 1596"###, 1597 &danger 1598 )?, 1599 r###"<pre><code>chunk1 1600 1601 chunk2 1602</code></pre> 1603"###, 1604 r###"Indented code blocks (112)"### 1605); 1606 1607 assert_eq!( 1608 to_html_with_options( 1609 r###"Foo 1610 bar 1611 1612"###, 1613 &danger 1614 )?, 1615 r###"<p>Foo 1616bar</p> 1617"###, 1618 r###"Indented code blocks (113)"### 1619); 1620 1621 assert_eq!( 1622 to_html_with_options( 1623 r###" foo 1624bar 1625"###, 1626 &danger 1627 )?, 1628 r###"<pre><code>foo 1629</code></pre> 1630<p>bar</p> 1631"###, 1632 r###"Indented code blocks (114)"### 1633); 1634 1635 assert_eq!( 1636 to_html_with_options( 1637 r###"# Heading 1638 foo 1639Heading 1640------ 1641 foo 1642---- 1643"###, 1644 &danger 1645 )?, 1646 r###"<h1>Heading</h1> 1647<pre><code>foo 1648</code></pre> 1649<h2>Heading</h2> 1650<pre><code>foo 1651</code></pre> 1652<hr /> 1653"###, 1654 r###"Indented code blocks (115)"### 1655); 1656 1657 assert_eq!( 1658 to_html_with_options( 1659 r###" foo 1660 bar 1661"###, 1662 &danger 1663 )?, 1664 r###"<pre><code> foo 1665bar 1666</code></pre> 1667"###, 1668 r###"Indented code blocks (116)"### 1669); 1670 1671 assert_eq!( 1672 to_html_with_options( 1673 r###" 1674 1675 foo 1676 1677 1678"###, 1679 &danger 1680 )?, 1681 r###"<pre><code>foo 1682</code></pre> 1683"###, 1684 r###"Indented code blocks (117)"### 1685); 1686 1687 assert_eq!( 1688 to_html_with_options( 1689 r###" foo 1690"###, 1691 &danger 1692 )?, 1693 r###"<pre><code>foo 1694</code></pre> 1695"###, 1696 r###"Indented code blocks (118)"### 1697); 1698 1699 assert_eq!( 1700 to_html_with_options( 1701 r###"``` 1702< 1703 > 1704``` 1705"###, 1706 &danger 1707 )?, 1708 r###"<pre><code>&lt; 1709 &gt; 1710</code></pre> 1711"###, 1712 r###"Fenced code blocks (119)"### 1713); 1714 1715 assert_eq!( 1716 to_html_with_options( 1717 r###"~~~ 1718< 1719 > 1720~~~ 1721"###, 1722 &danger 1723 )?, 1724 r###"<pre><code>&lt; 1725 &gt; 1726</code></pre> 1727"###, 1728 r###"Fenced code blocks (120)"### 1729); 1730 1731 assert_eq!( 1732 to_html_with_options( 1733 r###"`` 1734foo 1735`` 1736"###, 1737 &danger 1738 )?, 1739 r###"<p><code>foo</code></p> 1740"###, 1741 r###"Fenced code blocks (121)"### 1742); 1743 1744 assert_eq!( 1745 to_html_with_options( 1746 r###"``` 1747aaa 1748~~~ 1749``` 1750"###, 1751 &danger 1752 )?, 1753 r###"<pre><code>aaa 1754~~~ 1755</code></pre> 1756"###, 1757 r###"Fenced code blocks (122)"### 1758); 1759 1760 assert_eq!( 1761 to_html_with_options( 1762 r###"~~~ 1763aaa 1764``` 1765~~~ 1766"###, 1767 &danger 1768 )?, 1769 r###"<pre><code>aaa 1770``` 1771</code></pre> 1772"###, 1773 r###"Fenced code blocks (123)"### 1774); 1775 1776 assert_eq!( 1777 to_html_with_options( 1778 r###"```` 1779aaa 1780``` 1781`````` 1782"###, 1783 &danger 1784 )?, 1785 r###"<pre><code>aaa 1786``` 1787</code></pre> 1788"###, 1789 r###"Fenced code blocks (124)"### 1790); 1791 1792 assert_eq!( 1793 to_html_with_options( 1794 r###"~~~~ 1795aaa 1796~~~ 1797~~~~ 1798"###, 1799 &danger 1800 )?, 1801 r###"<pre><code>aaa 1802~~~ 1803</code></pre> 1804"###, 1805 r###"Fenced code blocks (125)"### 1806); 1807 1808 assert_eq!( 1809 to_html_with_options( 1810 r###"``` 1811"###, 1812 &danger 1813 )?, 1814 r###"<pre><code></code></pre> 1815"###, 1816 r###"Fenced code blocks (126)"### 1817); 1818 1819 assert_eq!( 1820 to_html_with_options( 1821 r###"````` 1822 1823``` 1824aaa 1825"###, 1826 &danger 1827 )?, 1828 r###"<pre><code> 1829``` 1830aaa 1831</code></pre> 1832"###, 1833 r###"Fenced code blocks (127)"### 1834); 1835 1836 assert_eq!( 1837 to_html_with_options( 1838 r###"> ``` 1839> aaa 1840 1841bbb 1842"###, 1843 &danger 1844 )?, 1845 r###"<blockquote> 1846<pre><code>aaa 1847</code></pre> 1848</blockquote> 1849<p>bbb</p> 1850"###, 1851 r###"Fenced code blocks (128)"### 1852); 1853 1854 assert_eq!( 1855 to_html_with_options( 1856 r###"``` 1857 1858 1859``` 1860"###, 1861 &danger 1862 )?, 1863 r###"<pre><code> 1864 1865</code></pre> 1866"###, 1867 r###"Fenced code blocks (129)"### 1868); 1869 1870 assert_eq!( 1871 to_html_with_options( 1872 r###"``` 1873``` 1874"###, 1875 &danger 1876 )?, 1877 r###"<pre><code></code></pre> 1878"###, 1879 r###"Fenced code blocks (130)"### 1880); 1881 1882 assert_eq!( 1883 to_html_with_options( 1884 r###" ``` 1885 aaa 1886aaa 1887``` 1888"###, 1889 &danger 1890 )?, 1891 r###"<pre><code>aaa 1892aaa 1893</code></pre> 1894"###, 1895 r###"Fenced code blocks (131)"### 1896); 1897 1898 assert_eq!( 1899 to_html_with_options( 1900 r###" ``` 1901aaa 1902 aaa 1903aaa 1904 ``` 1905"###, 1906 &danger 1907 )?, 1908 r###"<pre><code>aaa 1909aaa 1910aaa 1911</code></pre> 1912"###, 1913 r###"Fenced code blocks (132)"### 1914); 1915 1916 assert_eq!( 1917 to_html_with_options( 1918 r###" ``` 1919 aaa 1920 aaa 1921 aaa 1922 ``` 1923"###, 1924 &danger 1925 )?, 1926 r###"<pre><code>aaa 1927 aaa 1928aaa 1929</code></pre> 1930"###, 1931 r###"Fenced code blocks (133)"### 1932); 1933 1934 assert_eq!( 1935 to_html_with_options( 1936 r###" ``` 1937 aaa 1938 ``` 1939"###, 1940 &danger 1941 )?, 1942 r###"<pre><code>``` 1943aaa 1944``` 1945</code></pre> 1946"###, 1947 r###"Fenced code blocks (134)"### 1948); 1949 1950 assert_eq!( 1951 to_html_with_options( 1952 r###"``` 1953aaa 1954 ``` 1955"###, 1956 &danger 1957 )?, 1958 r###"<pre><code>aaa 1959</code></pre> 1960"###, 1961 r###"Fenced code blocks (135)"### 1962); 1963 1964 assert_eq!( 1965 to_html_with_options( 1966 r###" ``` 1967aaa 1968 ``` 1969"###, 1970 &danger 1971 )?, 1972 r###"<pre><code>aaa 1973</code></pre> 1974"###, 1975 r###"Fenced code blocks (136)"### 1976); 1977 1978 assert_eq!( 1979 to_html_with_options( 1980 r###"``` 1981aaa 1982 ``` 1983"###, 1984 &danger 1985 )?, 1986 r###"<pre><code>aaa 1987 ``` 1988</code></pre> 1989"###, 1990 r###"Fenced code blocks (137)"### 1991); 1992 1993 assert_eq!( 1994 to_html_with_options( 1995 r###"``` ``` 1996aaa 1997"###, 1998 &danger 1999 )?, 2000 r###"<p><code> </code> 2001aaa</p> 2002"###, 2003 r###"Fenced code blocks (138)"### 2004); 2005 2006 assert_eq!( 2007 to_html_with_options( 2008 r###"~~~~~~ 2009aaa 2010~~~ ~~ 2011"###, 2012 &danger 2013 )?, 2014 r###"<pre><code>aaa 2015~~~ ~~ 2016</code></pre> 2017"###, 2018 r###"Fenced code blocks (139)"### 2019); 2020 2021 assert_eq!( 2022 to_html_with_options( 2023 r###"foo 2024``` 2025bar 2026``` 2027baz 2028"###, 2029 &danger 2030 )?, 2031 r###"<p>foo</p> 2032<pre><code>bar 2033</code></pre> 2034<p>baz</p> 2035"###, 2036 r###"Fenced code blocks (140)"### 2037); 2038 2039 assert_eq!( 2040 to_html_with_options( 2041 r###"foo 2042--- 2043~~~ 2044bar 2045~~~ 2046# baz 2047"###, 2048 &danger 2049 )?, 2050 r###"<h2>foo</h2> 2051<pre><code>bar 2052</code></pre> 2053<h1>baz</h1> 2054"###, 2055 r###"Fenced code blocks (141)"### 2056); 2057 2058 assert_eq!( 2059 to_html_with_options( 2060 r###"```ruby 2061def foo(x) 2062 return 3 2063end 2064``` 2065"###, 2066 &danger 2067 )?, 2068 r###"<pre><code class="language-ruby">def foo(x) 2069 return 3 2070end 2071</code></pre> 2072"###, 2073 r###"Fenced code blocks (142)"### 2074); 2075 2076 assert_eq!( 2077 to_html_with_options( 2078 r###"~~~~ ruby startline=3 $%@#$ 2079def foo(x) 2080 return 3 2081end 2082~~~~~~~ 2083"###, 2084 &danger 2085 )?, 2086 r###"<pre><code class="language-ruby">def foo(x) 2087 return 3 2088end 2089</code></pre> 2090"###, 2091 r###"Fenced code blocks (143)"### 2092); 2093 2094 assert_eq!( 2095 to_html_with_options( 2096 r###"````; 2097```` 2098"###, 2099 &danger 2100 )?, 2101 r###"<pre><code class="language-;"></code></pre> 2102"###, 2103 r###"Fenced code blocks (144)"### 2104); 2105 2106 assert_eq!( 2107 to_html_with_options( 2108 r###"``` aa ``` 2109foo 2110"###, 2111 &danger 2112 )?, 2113 r###"<p><code>aa</code> 2114foo</p> 2115"###, 2116 r###"Fenced code blocks (145)"### 2117); 2118 2119 assert_eq!( 2120 to_html_with_options( 2121 r###"~~~ aa ``` ~~~ 2122foo 2123~~~ 2124"###, 2125 &danger 2126 )?, 2127 r###"<pre><code class="language-aa">foo 2128</code></pre> 2129"###, 2130 r###"Fenced code blocks (146)"### 2131); 2132 2133 assert_eq!( 2134 to_html_with_options( 2135 r###"``` 2136``` aaa 2137``` 2138"###, 2139 &danger 2140 )?, 2141 r###"<pre><code>``` aaa 2142</code></pre> 2143"###, 2144 r###"Fenced code blocks (147)"### 2145); 2146 2147 assert_eq!( 2148 to_html_with_options( 2149 r###"<table><tr><td> 2150<pre> 2151**Hello**, 2152 2153_world_. 2154</pre> 2155</td></tr></table> 2156"###, 2157 &danger 2158 )?, 2159 r###"<table><tr><td> 2160<pre> 2161**Hello**, 2162<p><em>world</em>. 2163</pre></p> 2164</td></tr></table> 2165"###, 2166 r###"HTML blocks (148)"### 2167); 2168 2169 assert_eq!( 2170 to_html_with_options( 2171 r###"<table> 2172 <tr> 2173 <td> 2174 hi 2175 </td> 2176 </tr> 2177</table> 2178 2179okay. 2180"###, 2181 &danger 2182 )?, 2183 r###"<table> 2184 <tr> 2185 <td> 2186 hi 2187 </td> 2188 </tr> 2189</table> 2190<p>okay.</p> 2191"###, 2192 r###"HTML blocks (149)"### 2193); 2194 2195 assert_eq!( 2196 to_html_with_options( 2197 r###" <div> 2198 *hello* 2199 <foo><a> 2200"###, 2201 &danger 2202 )?, 2203 r###" <div> 2204 *hello* 2205 <foo><a> 2206"###, 2207 r###"HTML blocks (150)"### 2208); 2209 2210 assert_eq!( 2211 to_html_with_options( 2212 r###"</div> 2213*foo* 2214"###, 2215 &danger 2216 )?, 2217 r###"</div> 2218*foo* 2219"###, 2220 r###"HTML blocks (151)"### 2221); 2222 2223 assert_eq!( 2224 to_html_with_options( 2225 r###"<DIV CLASS="foo"> 2226 2227*Markdown* 2228 2229</DIV> 2230"###, 2231 &danger 2232 )?, 2233 r###"<DIV CLASS="foo"> 2234<p><em>Markdown</em></p> 2235</DIV> 2236"###, 2237 r###"HTML blocks (152)"### 2238); 2239 2240 assert_eq!( 2241 to_html_with_options( 2242 r###"<div id="foo" 2243 class="bar"> 2244</div> 2245"###, 2246 &danger 2247 )?, 2248 r###"<div id="foo" 2249 class="bar"> 2250</div> 2251"###, 2252 r###"HTML blocks (153)"### 2253); 2254 2255 assert_eq!( 2256 to_html_with_options( 2257 r###"<div id="foo" class="bar 2258 baz"> 2259</div> 2260"###, 2261 &danger 2262 )?, 2263 r###"<div id="foo" class="bar 2264 baz"> 2265</div> 2266"###, 2267 r###"HTML blocks (154)"### 2268); 2269 2270 assert_eq!( 2271 to_html_with_options( 2272 r###"<div> 2273*foo* 2274 2275*bar* 2276"###, 2277 &danger 2278 )?, 2279 r###"<div> 2280*foo* 2281<p><em>bar</em></p> 2282"###, 2283 r###"HTML blocks (155)"### 2284); 2285 2286 assert_eq!( 2287 to_html_with_options( 2288 r###"<div id="foo" 2289*hi* 2290"###, 2291 &danger 2292 )?, 2293 r###"<div id="foo" 2294*hi* 2295"###, 2296 r###"HTML blocks (156)"### 2297); 2298 2299 assert_eq!( 2300 to_html_with_options( 2301 r###"<div class 2302foo 2303"###, 2304 &danger 2305 )?, 2306 r###"<div class 2307foo 2308"###, 2309 r###"HTML blocks (157)"### 2310); 2311 2312 assert_eq!( 2313 to_html_with_options( 2314 r###"<div *???-&&&-<--- 2315*foo* 2316"###, 2317 &danger 2318 )?, 2319 r###"<div *???-&&&-<--- 2320*foo* 2321"###, 2322 r###"HTML blocks (158)"### 2323); 2324 2325 assert_eq!( 2326 to_html_with_options( 2327 r###"<div><a href="bar">*foo*</a></div> 2328"###, 2329 &danger 2330 )?, 2331 r###"<div><a href="bar">*foo*</a></div> 2332"###, 2333 r###"HTML blocks (159)"### 2334); 2335 2336 assert_eq!( 2337 to_html_with_options( 2338 r###"<table><tr><td> 2339foo 2340</td></tr></table> 2341"###, 2342 &danger 2343 )?, 2344 r###"<table><tr><td> 2345foo 2346</td></tr></table> 2347"###, 2348 r###"HTML blocks (160)"### 2349); 2350 2351 assert_eq!( 2352 to_html_with_options( 2353 r###"<div></div> 2354``` c 2355int x = 33; 2356``` 2357"###, 2358 &danger 2359 )?, 2360 r###"<div></div> 2361``` c 2362int x = 33; 2363``` 2364"###, 2365 r###"HTML blocks (161)"### 2366); 2367 2368 assert_eq!( 2369 to_html_with_options( 2370 r###"<a href="foo"> 2371*bar* 2372</a> 2373"###, 2374 &danger 2375 )?, 2376 r###"<a href="foo"> 2377*bar* 2378</a> 2379"###, 2380 r###"HTML blocks (162)"### 2381); 2382 2383 assert_eq!( 2384 to_html_with_options( 2385 r###"<Warning> 2386*bar* 2387</Warning> 2388"###, 2389 &danger 2390 )?, 2391 r###"<Warning> 2392*bar* 2393</Warning> 2394"###, 2395 r###"HTML blocks (163)"### 2396); 2397 2398 assert_eq!( 2399 to_html_with_options( 2400 r###"<i class="foo"> 2401*bar* 2402</i> 2403"###, 2404 &danger 2405 )?, 2406 r###"<i class="foo"> 2407*bar* 2408</i> 2409"###, 2410 r###"HTML blocks (164)"### 2411); 2412 2413 assert_eq!( 2414 to_html_with_options( 2415 r###"</ins> 2416*bar* 2417"###, 2418 &danger 2419 )?, 2420 r###"</ins> 2421*bar* 2422"###, 2423 r###"HTML blocks (165)"### 2424); 2425 2426 assert_eq!( 2427 to_html_with_options( 2428 r###"<del> 2429*foo* 2430</del> 2431"###, 2432 &danger 2433 )?, 2434 r###"<del> 2435*foo* 2436</del> 2437"###, 2438 r###"HTML blocks (166)"### 2439); 2440 2441 assert_eq!( 2442 to_html_with_options( 2443 r###"<del> 2444 2445*foo* 2446 2447</del> 2448"###, 2449 &danger 2450 )?, 2451 r###"<del> 2452<p><em>foo</em></p> 2453</del> 2454"###, 2455 r###"HTML blocks (167)"### 2456); 2457 2458 assert_eq!( 2459 to_html_with_options( 2460 r###"<del>*foo*</del> 2461"###, 2462 &danger 2463 )?, 2464 r###"<p><del><em>foo</em></del></p> 2465"###, 2466 r###"HTML blocks (168)"### 2467); 2468 2469 assert_eq!( 2470 to_html_with_options( 2471 r###"<pre language="haskell"><code> 2472import Text.HTML.TagSoup 2473 2474main :: IO () 2475main = print $ parseTags tags 2476</code></pre> 2477okay 2478"###, 2479 &danger 2480 )?, 2481 r###"<pre language="haskell"><code> 2482import Text.HTML.TagSoup 2483 2484main :: IO () 2485main = print $ parseTags tags 2486</code></pre> 2487<p>okay</p> 2488"###, 2489 r###"HTML blocks (169)"### 2490); 2491 2492 assert_eq!( 2493 to_html_with_options( 2494 r###"<script type="text/javascript"> 2495// JavaScript example 2496 2497document.getElementById("demo").innerHTML = "Hello JavaScript!"; 2498</script> 2499okay 2500"###, 2501 &danger 2502 )?, 2503 r###"<script type="text/javascript"> 2504// JavaScript example 2505 2506document.getElementById("demo").innerHTML = "Hello JavaScript!"; 2507</script> 2508<p>okay</p> 2509"###, 2510 r###"HTML blocks (170)"### 2511); 2512 2513 assert_eq!( 2514 to_html_with_options( 2515 r###"<textarea> 2516 2517*foo* 2518 2519_bar_ 2520 2521</textarea> 2522"###, 2523 &danger 2524 )?, 2525 r###"<textarea> 2526 2527*foo* 2528 2529_bar_ 2530 2531</textarea> 2532"###, 2533 r###"HTML blocks (171)"### 2534); 2535 2536 assert_eq!( 2537 to_html_with_options( 2538 r###"<style 2539 type="text/css"> 2540h1 {color:red;} 2541 2542p {color:blue;} 2543</style> 2544okay 2545"###, 2546 &danger 2547 )?, 2548 r###"<style 2549 type="text/css"> 2550h1 {color:red;} 2551 2552p {color:blue;} 2553</style> 2554<p>okay</p> 2555"###, 2556 r###"HTML blocks (172)"### 2557); 2558 2559 assert_eq!( 2560 to_html_with_options( 2561 r###"<style 2562 type="text/css"> 2563 2564foo 2565"###, 2566 &danger 2567 )?, 2568 r###"<style 2569 type="text/css"> 2570 2571foo 2572"###, 2573 r###"HTML blocks (173)"### 2574); 2575 2576 assert_eq!( 2577 to_html_with_options( 2578 r###"> <div> 2579> foo 2580 2581bar 2582"###, 2583 &danger 2584 )?, 2585 r###"<blockquote> 2586<div> 2587foo 2588</blockquote> 2589<p>bar</p> 2590"###, 2591 r###"HTML blocks (174)"### 2592); 2593 2594 assert_eq!( 2595 to_html_with_options( 2596 r###"- <div> 2597- foo 2598"###, 2599 &danger 2600 )?, 2601 r###"<ul> 2602<li> 2603<div> 2604</li> 2605<li>foo</li> 2606</ul> 2607"###, 2608 r###"HTML blocks (175)"### 2609); 2610 2611 assert_eq!( 2612 to_html_with_options( 2613 r###"<style>p{color:red;}</style> 2614*foo* 2615"###, 2616 &danger 2617 )?, 2618 r###"<style>p{color:red;}</style> 2619<p><em>foo</em></p> 2620"###, 2621 r###"HTML blocks (176)"### 2622); 2623 2624 assert_eq!( 2625 to_html_with_options( 2626 r###"<!-- foo -->*bar* 2627*baz* 2628"###, 2629 &danger 2630 )?, 2631 r###"<!-- foo -->*bar* 2632<p><em>baz</em></p> 2633"###, 2634 r###"HTML blocks (177)"### 2635); 2636 2637 assert_eq!( 2638 to_html_with_options( 2639 r###"<script> 2640foo 2641</script>1. *bar* 2642"###, 2643 &danger 2644 )?, 2645 r###"<script> 2646foo 2647</script>1. *bar* 2648"###, 2649 r###"HTML blocks (178)"### 2650); 2651 2652 assert_eq!( 2653 to_html_with_options( 2654 r###"<!-- Foo 2655 2656bar 2657 baz --> 2658okay 2659"###, 2660 &danger 2661 )?, 2662 r###"<!-- Foo 2663 2664bar 2665 baz --> 2666<p>okay</p> 2667"###, 2668 r###"HTML blocks (179)"### 2669); 2670 2671 assert_eq!( 2672 to_html_with_options( 2673 r###"<?php 2674 2675 echo '>'; 2676 2677?> 2678okay 2679"###, 2680 &danger 2681 )?, 2682 r###"<?php 2683 2684 echo '>'; 2685 2686?> 2687<p>okay</p> 2688"###, 2689 r###"HTML blocks (180)"### 2690); 2691 2692 assert_eq!( 2693 to_html_with_options( 2694 r###"<!DOCTYPE html> 2695"###, 2696 &danger 2697 )?, 2698 r###"<!DOCTYPE html> 2699"###, 2700 r###"HTML blocks (181)"### 2701); 2702 2703 assert_eq!( 2704 to_html_with_options( 2705 r###"<![CDATA[ 2706function matchwo(a,b) 2707{ 2708 if (a < b && a < 0) then { 2709 return 1; 2710 2711 } else { 2712 2713 return 0; 2714 } 2715} 2716]]> 2717okay 2718"###, 2719 &danger 2720 )?, 2721 r###"<![CDATA[ 2722function matchwo(a,b) 2723{ 2724 if (a < b && a < 0) then { 2725 return 1; 2726 2727 } else { 2728 2729 return 0; 2730 } 2731} 2732]]> 2733<p>okay</p> 2734"###, 2735 r###"HTML blocks (182)"### 2736); 2737 2738 assert_eq!( 2739 to_html_with_options( 2740 r###" <!-- foo --> 2741 2742 <!-- foo --> 2743"###, 2744 &danger 2745 )?, 2746 r###" <!-- foo --> 2747<pre><code>&lt;!-- foo --&gt; 2748</code></pre> 2749"###, 2750 r###"HTML blocks (183)"### 2751); 2752 2753 assert_eq!( 2754 to_html_with_options( 2755 r###" <div> 2756 2757 <div> 2758"###, 2759 &danger 2760 )?, 2761 r###" <div> 2762<pre><code>&lt;div&gt; 2763</code></pre> 2764"###, 2765 r###"HTML blocks (184)"### 2766); 2767 2768 assert_eq!( 2769 to_html_with_options( 2770 r###"Foo 2771<div> 2772bar 2773</div> 2774"###, 2775 &danger 2776 )?, 2777 r###"<p>Foo</p> 2778<div> 2779bar 2780</div> 2781"###, 2782 r###"HTML blocks (185)"### 2783); 2784 2785 assert_eq!( 2786 to_html_with_options( 2787 r###"<div> 2788bar 2789</div> 2790*foo* 2791"###, 2792 &danger 2793 )?, 2794 r###"<div> 2795bar 2796</div> 2797*foo* 2798"###, 2799 r###"HTML blocks (186)"### 2800); 2801 2802 assert_eq!( 2803 to_html_with_options( 2804 r###"Foo 2805<a href="bar"> 2806baz 2807"###, 2808 &danger 2809 )?, 2810 r###"<p>Foo 2811<a href="bar"> 2812baz</p> 2813"###, 2814 r###"HTML blocks (187)"### 2815); 2816 2817 assert_eq!( 2818 to_html_with_options( 2819 r###"<div> 2820 2821*Emphasized* text. 2822 2823</div> 2824"###, 2825 &danger 2826 )?, 2827 r###"<div> 2828<p><em>Emphasized</em> text.</p> 2829</div> 2830"###, 2831 r###"HTML blocks (188)"### 2832); 2833 2834 assert_eq!( 2835 to_html_with_options( 2836 r###"<div> 2837*Emphasized* text. 2838</div> 2839"###, 2840 &danger 2841 )?, 2842 r###"<div> 2843*Emphasized* text. 2844</div> 2845"###, 2846 r###"HTML blocks (189)"### 2847); 2848 2849 assert_eq!( 2850 to_html_with_options( 2851 r###"<table> 2852 2853<tr> 2854 2855<td> 2856Hi 2857</td> 2858 2859</tr> 2860 2861</table> 2862"###, 2863 &danger 2864 )?, 2865 r###"<table> 2866<tr> 2867<td> 2868Hi 2869</td> 2870</tr> 2871</table> 2872"###, 2873 r###"HTML blocks (190)"### 2874); 2875 2876 assert_eq!( 2877 to_html_with_options( 2878 r###"<table> 2879 2880 <tr> 2881 2882 <td> 2883 Hi 2884 </td> 2885 2886 </tr> 2887 2888</table> 2889"###, 2890 &danger 2891 )?, 2892 r###"<table> 2893 <tr> 2894<pre><code>&lt;td&gt; 2895 Hi 2896&lt;/td&gt; 2897</code></pre> 2898 </tr> 2899</table> 2900"###, 2901 r###"HTML blocks (191)"### 2902); 2903 2904 assert_eq!( 2905 to_html_with_options( 2906 r###"[foo]: /url "title" 2907 2908[foo] 2909"###, 2910 &danger 2911 )?, 2912 r###"<p><a href="/url" title="title">foo</a></p> 2913"###, 2914 r###"Link reference definitions (192)"### 2915); 2916 2917 assert_eq!( 2918 to_html_with_options( 2919 r###" [foo]: 2920 /url 2921 'the title' 2922 2923[foo] 2924"###, 2925 &danger 2926 )?, 2927 r###"<p><a href="/url" title="the title">foo</a></p> 2928"###, 2929 r###"Link reference definitions (193)"### 2930); 2931 2932 assert_eq!( 2933 to_html_with_options( 2934 r###"[Foo*bar\]]:my_(url) 'title (with parens)' 2935 2936[Foo*bar\]] 2937"###, 2938 &danger 2939 )?, 2940 r###"<p><a href="my_(url)" title="title (with parens)">Foo*bar]</a></p> 2941"###, 2942 r###"Link reference definitions (194)"### 2943); 2944 2945 assert_eq!( 2946 to_html_with_options( 2947 r###"[Foo bar]: 2948<my url> 2949'title' 2950 2951[Foo bar] 2952"###, 2953 &danger 2954 )?, 2955 r###"<p><a href="my%20url" title="title">Foo bar</a></p> 2956"###, 2957 r###"Link reference definitions (195)"### 2958); 2959 2960 assert_eq!( 2961 to_html_with_options( 2962 r###"[foo]: /url ' 2963title 2964line1 2965line2 2966' 2967 2968[foo] 2969"###, 2970 &danger 2971 )?, 2972 r###"<p><a href="/url" title=" 2973title 2974line1 2975line2 2976">foo</a></p> 2977"###, 2978 r###"Link reference definitions (196)"### 2979); 2980 2981 assert_eq!( 2982 to_html_with_options( 2983 r###"[foo]: /url 'title 2984 2985with blank line' 2986 2987[foo] 2988"###, 2989 &danger 2990 )?, 2991 r###"<p>[foo]: /url 'title</p> 2992<p>with blank line'</p> 2993<p>[foo]</p> 2994"###, 2995 r###"Link reference definitions (197)"### 2996); 2997 2998 assert_eq!( 2999 to_html_with_options( 3000 r###"[foo]: 3001/url 3002 3003[foo] 3004"###, 3005 &danger 3006 )?, 3007 r###"<p><a href="/url">foo</a></p> 3008"###, 3009 r###"Link reference definitions (198)"### 3010); 3011 3012 assert_eq!( 3013 to_html_with_options( 3014 r###"[foo]: 3015 3016[foo] 3017"###, 3018 &danger 3019 )?, 3020 r###"<p>[foo]:</p> 3021<p>[foo]</p> 3022"###, 3023 r###"Link reference definitions (199)"### 3024); 3025 3026 assert_eq!( 3027 to_html_with_options( 3028 r###"[foo]: <> 3029 3030[foo] 3031"###, 3032 &danger 3033 )?, 3034 r###"<p><a href="">foo</a></p> 3035"###, 3036 r###"Link reference definitions (200)"### 3037); 3038 3039 assert_eq!( 3040 to_html_with_options( 3041 r###"[foo]: <bar>(baz) 3042 3043[foo] 3044"###, 3045 &danger 3046 )?, 3047 r###"<p>[foo]: <bar>(baz)</p> 3048<p>[foo]</p> 3049"###, 3050 r###"Link reference definitions (201)"### 3051); 3052 3053 assert_eq!( 3054 to_html_with_options( 3055 r###"[foo]: /url\bar\*baz "foo\"bar\baz" 3056 3057[foo] 3058"###, 3059 &danger 3060 )?, 3061 r###"<p><a href="/url%5Cbar*baz" title="foo&quot;bar\baz">foo</a></p> 3062"###, 3063 r###"Link reference definitions (202)"### 3064); 3065 3066 assert_eq!( 3067 to_html_with_options( 3068 r###"[foo] 3069 3070[foo]: url 3071"###, 3072 &danger 3073 )?, 3074 r###"<p><a href="url">foo</a></p> 3075"###, 3076 r###"Link reference definitions (203)"### 3077); 3078 3079 assert_eq!( 3080 to_html_with_options( 3081 r###"[foo] 3082 3083[foo]: first 3084[foo]: second 3085"###, 3086 &danger 3087 )?, 3088 r###"<p><a href="first">foo</a></p> 3089"###, 3090 r###"Link reference definitions (204)"### 3091); 3092 3093 assert_eq!( 3094 to_html_with_options( 3095 r###"[FOO]: /url 3096 3097[Foo] 3098"###, 3099 &danger 3100 )?, 3101 r###"<p><a href="/url">Foo</a></p> 3102"###, 3103 r###"Link reference definitions (205)"### 3104); 3105 3106 assert_eq!( 3107 to_html_with_options( 3108 r###"[ΑΓΩ]: /φου 3109 3110[αγω] 3111"###, 3112 &danger 3113 )?, 3114 r###"<p><a href="/%CF%86%CE%BF%CF%85">αγω</a></p> 3115"###, 3116 r###"Link reference definitions (206)"### 3117); 3118 3119 assert_eq!( 3120 to_html_with_options( 3121 r###"[foo]: /url 3122"###, 3123 &danger 3124 )?, 3125 r###""###, 3126 r###"Link reference definitions (207)"### 3127); 3128 3129 assert_eq!( 3130 to_html_with_options( 3131 r###"[ 3132foo 3133]: /url 3134bar 3135"###, 3136 &danger 3137 )?, 3138 r###"<p>bar</p> 3139"###, 3140 r###"Link reference definitions (208)"### 3141); 3142 3143 assert_eq!( 3144 to_html_with_options( 3145 r###"[foo]: /url "title" ok 3146"###, 3147 &danger 3148 )?, 3149 r###"<p>[foo]: /url &quot;title&quot; ok</p> 3150"###, 3151 r###"Link reference definitions (209)"### 3152); 3153 3154 assert_eq!( 3155 to_html_with_options( 3156 r###"[foo]: /url 3157"title" ok 3158"###, 3159 &danger 3160 )?, 3161 r###"<p>&quot;title&quot; ok</p> 3162"###, 3163 r###"Link reference definitions (210)"### 3164); 3165 3166 assert_eq!( 3167 to_html_with_options( 3168 r###" [foo]: /url "title" 3169 3170[foo] 3171"###, 3172 &danger 3173 )?, 3174 r###"<pre><code>[foo]: /url &quot;title&quot; 3175</code></pre> 3176<p>[foo]</p> 3177"###, 3178 r###"Link reference definitions (211)"### 3179); 3180 3181 assert_eq!( 3182 to_html_with_options( 3183 r###"``` 3184[foo]: /url 3185``` 3186 3187[foo] 3188"###, 3189 &danger 3190 )?, 3191 r###"<pre><code>[foo]: /url 3192</code></pre> 3193<p>[foo]</p> 3194"###, 3195 r###"Link reference definitions (212)"### 3196); 3197 3198 assert_eq!( 3199 to_html_with_options( 3200 r###"Foo 3201[bar]: /baz 3202 3203[bar] 3204"###, 3205 &danger 3206 )?, 3207 r###"<p>Foo 3208[bar]: /baz</p> 3209<p>[bar]</p> 3210"###, 3211 r###"Link reference definitions (213)"### 3212); 3213 3214 assert_eq!( 3215 to_html_with_options( 3216 r###"# [Foo] 3217[foo]: /url 3218> bar 3219"###, 3220 &danger 3221 )?, 3222 r###"<h1><a href="/url">Foo</a></h1> 3223<blockquote> 3224<p>bar</p> 3225</blockquote> 3226"###, 3227 r###"Link reference definitions (214)"### 3228); 3229 3230 assert_eq!( 3231 to_html_with_options( 3232 r###"[foo]: /url 3233bar 3234=== 3235[foo] 3236"###, 3237 &danger 3238 )?, 3239 r###"<h1>bar</h1> 3240<p><a href="/url">foo</a></p> 3241"###, 3242 r###"Link reference definitions (215)"### 3243); 3244 3245 assert_eq!( 3246 to_html_with_options( 3247 r###"[foo]: /url 3248=== 3249[foo] 3250"###, 3251 &danger 3252 )?, 3253 r###"<p>=== 3254<a href="/url">foo</a></p> 3255"###, 3256 r###"Link reference definitions (216)"### 3257); 3258 3259 assert_eq!( 3260 to_html_with_options( 3261 r###"[foo]: /foo-url "foo" 3262[bar]: /bar-url 3263 "bar" 3264[baz]: /baz-url 3265 3266[foo], 3267[bar], 3268[baz] 3269"###, 3270 &danger 3271 )?, 3272 r###"<p><a href="/foo-url" title="foo">foo</a>, 3273<a href="/bar-url" title="bar">bar</a>, 3274<a href="/baz-url">baz</a></p> 3275"###, 3276 r###"Link reference definitions (217)"### 3277); 3278 3279 assert_eq!( 3280 to_html_with_options( 3281 r###"[foo] 3282 3283> [foo]: /url 3284"###, 3285 &danger 3286 )?, 3287 r###"<p><a href="/url">foo</a></p> 3288<blockquote> 3289</blockquote> 3290"###, 3291 r###"Link reference definitions (218)"### 3292); 3293 3294 assert_eq!( 3295 to_html_with_options( 3296 r###"aaa 3297 3298bbb 3299"###, 3300 &danger 3301 )?, 3302 r###"<p>aaa</p> 3303<p>bbb</p> 3304"###, 3305 r###"Paragraphs (219)"### 3306); 3307 3308 assert_eq!( 3309 to_html_with_options( 3310 r###"aaa 3311bbb 3312 3313ccc 3314ddd 3315"###, 3316 &danger 3317 )?, 3318 r###"<p>aaa 3319bbb</p> 3320<p>ccc 3321ddd</p> 3322"###, 3323 r###"Paragraphs (220)"### 3324); 3325 3326 assert_eq!( 3327 to_html_with_options( 3328 r###"aaa 3329 3330 3331bbb 3332"###, 3333 &danger 3334 )?, 3335 r###"<p>aaa</p> 3336<p>bbb</p> 3337"###, 3338 r###"Paragraphs (221)"### 3339); 3340 3341 assert_eq!( 3342 to_html_with_options( 3343 r###" aaa 3344 bbb 3345"###, 3346 &danger 3347 )?, 3348 r###"<p>aaa 3349bbb</p> 3350"###, 3351 r###"Paragraphs (222)"### 3352); 3353 3354 assert_eq!( 3355 to_html_with_options( 3356 r###"aaa 3357 bbb 3358 ccc 3359"###, 3360 &danger 3361 )?, 3362 r###"<p>aaa 3363bbb 3364ccc</p> 3365"###, 3366 r###"Paragraphs (223)"### 3367); 3368 3369 assert_eq!( 3370 to_html_with_options( 3371 r###" aaa 3372bbb 3373"###, 3374 &danger 3375 )?, 3376 r###"<p>aaa 3377bbb</p> 3378"###, 3379 r###"Paragraphs (224)"### 3380); 3381 3382 assert_eq!( 3383 to_html_with_options( 3384 r###" aaa 3385bbb 3386"###, 3387 &danger 3388 )?, 3389 r###"<pre><code>aaa 3390</code></pre> 3391<p>bbb</p> 3392"###, 3393 r###"Paragraphs (225)"### 3394); 3395 3396 assert_eq!( 3397 to_html_with_options( 3398 r###"aaa 3399bbb 3400"###, 3401 &danger 3402 )?, 3403 r###"<p>aaa<br /> 3404bbb</p> 3405"###, 3406 r###"Paragraphs (226)"### 3407); 3408 3409 assert_eq!( 3410 to_html_with_options( 3411 r###" 3412 3413aaa 3414 3415 3416# aaa 3417 3418 3419"###, 3420 &danger 3421 )?, 3422 r###"<p>aaa</p> 3423<h1>aaa</h1> 3424"###, 3425 r###"Blank lines (227)"### 3426); 3427 3428 assert_eq!( 3429 to_html_with_options( 3430 r###"> # Foo 3431> bar 3432> baz 3433"###, 3434 &danger 3435 )?, 3436 r###"<blockquote> 3437<h1>Foo</h1> 3438<p>bar 3439baz</p> 3440</blockquote> 3441"###, 3442 r###"Block quotes (228)"### 3443); 3444 3445 assert_eq!( 3446 to_html_with_options( 3447 r###"># Foo 3448>bar 3449> baz 3450"###, 3451 &danger 3452 )?, 3453 r###"<blockquote> 3454<h1>Foo</h1> 3455<p>bar 3456baz</p> 3457</blockquote> 3458"###, 3459 r###"Block quotes (229)"### 3460); 3461 3462 assert_eq!( 3463 to_html_with_options( 3464 r###" > # Foo 3465 > bar 3466 > baz 3467"###, 3468 &danger 3469 )?, 3470 r###"<blockquote> 3471<h1>Foo</h1> 3472<p>bar 3473baz</p> 3474</blockquote> 3475"###, 3476 r###"Block quotes (230)"### 3477); 3478 3479 assert_eq!( 3480 to_html_with_options( 3481 r###" > # Foo 3482 > bar 3483 > baz 3484"###, 3485 &danger 3486 )?, 3487 r###"<pre><code>&gt; # Foo 3488&gt; bar 3489&gt; baz 3490</code></pre> 3491"###, 3492 r###"Block quotes (231)"### 3493); 3494 3495 assert_eq!( 3496 to_html_with_options( 3497 r###"> # Foo 3498> bar 3499baz 3500"###, 3501 &danger 3502 )?, 3503 r###"<blockquote> 3504<h1>Foo</h1> 3505<p>bar 3506baz</p> 3507</blockquote> 3508"###, 3509 r###"Block quotes (232)"### 3510); 3511 3512 assert_eq!( 3513 to_html_with_options( 3514 r###"> bar 3515baz 3516> foo 3517"###, 3518 &danger 3519 )?, 3520 r###"<blockquote> 3521<p>bar 3522baz 3523foo</p> 3524</blockquote> 3525"###, 3526 r###"Block quotes (233)"### 3527); 3528 3529 assert_eq!( 3530 to_html_with_options( 3531 r###"> foo 3532--- 3533"###, 3534 &danger 3535 )?, 3536 r###"<blockquote> 3537<p>foo</p> 3538</blockquote> 3539<hr /> 3540"###, 3541 r###"Block quotes (234)"### 3542); 3543 3544 assert_eq!( 3545 to_html_with_options( 3546 r###"> - foo 3547- bar 3548"###, 3549 &danger 3550 )?, 3551 r###"<blockquote> 3552<ul> 3553<li>foo</li> 3554</ul> 3555</blockquote> 3556<ul> 3557<li>bar</li> 3558</ul> 3559"###, 3560 r###"Block quotes (235)"### 3561); 3562 3563 assert_eq!( 3564 to_html_with_options( 3565 r###"> foo 3566 bar 3567"###, 3568 &danger 3569 )?, 3570 r###"<blockquote> 3571<pre><code>foo 3572</code></pre> 3573</blockquote> 3574<pre><code>bar 3575</code></pre> 3576"###, 3577 r###"Block quotes (236)"### 3578); 3579 3580 assert_eq!( 3581 to_html_with_options( 3582 r###"> ``` 3583foo 3584``` 3585"###, 3586 &danger 3587 )?, 3588 r###"<blockquote> 3589<pre><code></code></pre> 3590</blockquote> 3591<p>foo</p> 3592<pre><code></code></pre> 3593"###, 3594 r###"Block quotes (237)"### 3595); 3596 3597 assert_eq!( 3598 to_html_with_options( 3599 r###"> foo 3600 - bar 3601"###, 3602 &danger 3603 )?, 3604 r###"<blockquote> 3605<p>foo 3606- bar</p> 3607</blockquote> 3608"###, 3609 r###"Block quotes (238)"### 3610); 3611 3612 assert_eq!( 3613 to_html_with_options( 3614 r###"> 3615"###, 3616 &danger 3617 )?, 3618 r###"<blockquote> 3619</blockquote> 3620"###, 3621 r###"Block quotes (239)"### 3622); 3623 3624 assert_eq!( 3625 to_html_with_options( 3626 r###"> 3627> 3628> 3629"###, 3630 &danger 3631 )?, 3632 r###"<blockquote> 3633</blockquote> 3634"###, 3635 r###"Block quotes (240)"### 3636); 3637 3638 assert_eq!( 3639 to_html_with_options( 3640 r###"> 3641> foo 3642> 3643"###, 3644 &danger 3645 )?, 3646 r###"<blockquote> 3647<p>foo</p> 3648</blockquote> 3649"###, 3650 r###"Block quotes (241)"### 3651); 3652 3653 assert_eq!( 3654 to_html_with_options( 3655 r###"> foo 3656 3657> bar 3658"###, 3659 &danger 3660 )?, 3661 r###"<blockquote> 3662<p>foo</p> 3663</blockquote> 3664<blockquote> 3665<p>bar</p> 3666</blockquote> 3667"###, 3668 r###"Block quotes (242)"### 3669); 3670 3671 assert_eq!( 3672 to_html_with_options( 3673 r###"> foo 3674> bar 3675"###, 3676 &danger 3677 )?, 3678 r###"<blockquote> 3679<p>foo 3680bar</p> 3681</blockquote> 3682"###, 3683 r###"Block quotes (243)"### 3684); 3685 3686 assert_eq!( 3687 to_html_with_options( 3688 r###"> foo 3689> 3690> bar 3691"###, 3692 &danger 3693 )?, 3694 r###"<blockquote> 3695<p>foo</p> 3696<p>bar</p> 3697</blockquote> 3698"###, 3699 r###"Block quotes (244)"### 3700); 3701 3702 assert_eq!( 3703 to_html_with_options( 3704 r###"foo 3705> bar 3706"###, 3707 &danger 3708 )?, 3709 r###"<p>foo</p> 3710<blockquote> 3711<p>bar</p> 3712</blockquote> 3713"###, 3714 r###"Block quotes (245)"### 3715); 3716 3717 assert_eq!( 3718 to_html_with_options( 3719 r###"> aaa 3720*** 3721> bbb 3722"###, 3723 &danger 3724 )?, 3725 r###"<blockquote> 3726<p>aaa</p> 3727</blockquote> 3728<hr /> 3729<blockquote> 3730<p>bbb</p> 3731</blockquote> 3732"###, 3733 r###"Block quotes (246)"### 3734); 3735 3736 assert_eq!( 3737 to_html_with_options( 3738 r###"> bar 3739baz 3740"###, 3741 &danger 3742 )?, 3743 r###"<blockquote> 3744<p>bar 3745baz</p> 3746</blockquote> 3747"###, 3748 r###"Block quotes (247)"### 3749); 3750 3751 assert_eq!( 3752 to_html_with_options( 3753 r###"> bar 3754 3755baz 3756"###, 3757 &danger 3758 )?, 3759 r###"<blockquote> 3760<p>bar</p> 3761</blockquote> 3762<p>baz</p> 3763"###, 3764 r###"Block quotes (248)"### 3765); 3766 3767 assert_eq!( 3768 to_html_with_options( 3769 r###"> bar 3770> 3771baz 3772"###, 3773 &danger 3774 )?, 3775 r###"<blockquote> 3776<p>bar</p> 3777</blockquote> 3778<p>baz</p> 3779"###, 3780 r###"Block quotes (249)"### 3781); 3782 3783 assert_eq!( 3784 to_html_with_options( 3785 r###"> > > foo 3786bar 3787"###, 3788 &danger 3789 )?, 3790 r###"<blockquote> 3791<blockquote> 3792<blockquote> 3793<p>foo 3794bar</p> 3795</blockquote> 3796</blockquote> 3797</blockquote> 3798"###, 3799 r###"Block quotes (250)"### 3800); 3801 3802 assert_eq!( 3803 to_html_with_options( 3804 r###">>> foo 3805> bar 3806>>baz 3807"###, 3808 &danger 3809 )?, 3810 r###"<blockquote> 3811<blockquote> 3812<blockquote> 3813<p>foo 3814bar 3815baz</p> 3816</blockquote> 3817</blockquote> 3818</blockquote> 3819"###, 3820 r###"Block quotes (251)"### 3821); 3822 3823 assert_eq!( 3824 to_html_with_options( 3825 r###"> code 3826 3827> not code 3828"###, 3829 &danger 3830 )?, 3831 r###"<blockquote> 3832<pre><code>code 3833</code></pre> 3834</blockquote> 3835<blockquote> 3836<p>not code</p> 3837</blockquote> 3838"###, 3839 r###"Block quotes (252)"### 3840); 3841 3842 assert_eq!( 3843 to_html_with_options( 3844 r###"A paragraph 3845with two lines. 3846 3847 indented code 3848 3849> A block quote. 3850"###, 3851 &danger 3852 )?, 3853 r###"<p>A paragraph 3854with two lines.</p> 3855<pre><code>indented code 3856</code></pre> 3857<blockquote> 3858<p>A block quote.</p> 3859</blockquote> 3860"###, 3861 r###"List items (253)"### 3862); 3863 3864 assert_eq!( 3865 to_html_with_options( 3866 r###"1. A paragraph 3867 with two lines. 3868 3869 indented code 3870 3871 > A block quote. 3872"###, 3873 &danger 3874 )?, 3875 r###"<ol> 3876<li> 3877<p>A paragraph 3878with two lines.</p> 3879<pre><code>indented code 3880</code></pre> 3881<blockquote> 3882<p>A block quote.</p> 3883</blockquote> 3884</li> 3885</ol> 3886"###, 3887 r###"List items (254)"### 3888); 3889 3890 assert_eq!( 3891 to_html_with_options( 3892 r###"- one 3893 3894 two 3895"###, 3896 &danger 3897 )?, 3898 r###"<ul> 3899<li>one</li> 3900</ul> 3901<p>two</p> 3902"###, 3903 r###"List items (255)"### 3904); 3905 3906 assert_eq!( 3907 to_html_with_options( 3908 r###"- one 3909 3910 two 3911"###, 3912 &danger 3913 )?, 3914 r###"<ul> 3915<li> 3916<p>one</p> 3917<p>two</p> 3918</li> 3919</ul> 3920"###, 3921 r###"List items (256)"### 3922); 3923 3924 assert_eq!( 3925 to_html_with_options( 3926 r###" - one 3927 3928 two 3929"###, 3930 &danger 3931 )?, 3932 r###"<ul> 3933<li>one</li> 3934</ul> 3935<pre><code> two 3936</code></pre> 3937"###, 3938 r###"List items (257)"### 3939); 3940 3941 assert_eq!( 3942 to_html_with_options( 3943 r###" - one 3944 3945 two 3946"###, 3947 &danger 3948 )?, 3949 r###"<ul> 3950<li> 3951<p>one</p> 3952<p>two</p> 3953</li> 3954</ul> 3955"###, 3956 r###"List items (258)"### 3957); 3958 3959 assert_eq!( 3960 to_html_with_options( 3961 r###" > > 1. one 3962>> 3963>> two 3964"###, 3965 &danger 3966 )?, 3967 r###"<blockquote> 3968<blockquote> 3969<ol> 3970<li> 3971<p>one</p> 3972<p>two</p> 3973</li> 3974</ol> 3975</blockquote> 3976</blockquote> 3977"###, 3978 r###"List items (259)"### 3979); 3980 3981 assert_eq!( 3982 to_html_with_options( 3983 r###">>- one 3984>> 3985 > > two 3986"###, 3987 &danger 3988 )?, 3989 r###"<blockquote> 3990<blockquote> 3991<ul> 3992<li>one</li> 3993</ul> 3994<p>two</p> 3995</blockquote> 3996</blockquote> 3997"###, 3998 r###"List items (260)"### 3999); 4000 4001 assert_eq!( 4002 to_html_with_options( 4003 r###"-one 4004 40052.two 4006"###, 4007 &danger 4008 )?, 4009 r###"<p>-one</p> 4010<p>2.two</p> 4011"###, 4012 r###"List items (261)"### 4013); 4014 4015 assert_eq!( 4016 to_html_with_options( 4017 r###"- foo 4018 4019 4020 bar 4021"###, 4022 &danger 4023 )?, 4024 r###"<ul> 4025<li> 4026<p>foo</p> 4027<p>bar</p> 4028</li> 4029</ul> 4030"###, 4031 r###"List items (262)"### 4032); 4033 4034 assert_eq!( 4035 to_html_with_options( 4036 r###"1. foo 4037 4038 ``` 4039 bar 4040 ``` 4041 4042 baz 4043 4044 > bam 4045"###, 4046 &danger 4047 )?, 4048 r###"<ol> 4049<li> 4050<p>foo</p> 4051<pre><code>bar 4052</code></pre> 4053<p>baz</p> 4054<blockquote> 4055<p>bam</p> 4056</blockquote> 4057</li> 4058</ol> 4059"###, 4060 r###"List items (263)"### 4061); 4062 4063 assert_eq!( 4064 to_html_with_options( 4065 r###"- Foo 4066 4067 bar 4068 4069 4070 baz 4071"###, 4072 &danger 4073 )?, 4074 r###"<ul> 4075<li> 4076<p>Foo</p> 4077<pre><code>bar 4078 4079 4080baz 4081</code></pre> 4082</li> 4083</ul> 4084"###, 4085 r###"List items (264)"### 4086); 4087 4088 assert_eq!( 4089 to_html_with_options( 4090 r###"123456789. ok 4091"###, 4092 &danger 4093 )?, 4094 r###"<ol start="123456789"> 4095<li>ok</li> 4096</ol> 4097"###, 4098 r###"List items (265)"### 4099); 4100 4101 assert_eq!( 4102 to_html_with_options( 4103 r###"1234567890. not ok 4104"###, 4105 &danger 4106 )?, 4107 r###"<p>1234567890. not ok</p> 4108"###, 4109 r###"List items (266)"### 4110); 4111 4112 assert_eq!( 4113 to_html_with_options( 4114 r###"0. ok 4115"###, 4116 &danger 4117 )?, 4118 r###"<ol start="0"> 4119<li>ok</li> 4120</ol> 4121"###, 4122 r###"List items (267)"### 4123); 4124 4125 assert_eq!( 4126 to_html_with_options( 4127 r###"003. ok 4128"###, 4129 &danger 4130 )?, 4131 r###"<ol start="3"> 4132<li>ok</li> 4133</ol> 4134"###, 4135 r###"List items (268)"### 4136); 4137 4138 assert_eq!( 4139 to_html_with_options( 4140 r###"-1. not ok 4141"###, 4142 &danger 4143 )?, 4144 r###"<p>-1. not ok</p> 4145"###, 4146 r###"List items (269)"### 4147); 4148 4149 assert_eq!( 4150 to_html_with_options( 4151 r###"- foo 4152 4153 bar 4154"###, 4155 &danger 4156 )?, 4157 r###"<ul> 4158<li> 4159<p>foo</p> 4160<pre><code>bar 4161</code></pre> 4162</li> 4163</ul> 4164"###, 4165 r###"List items (270)"### 4166); 4167 4168 assert_eq!( 4169 to_html_with_options( 4170 r###" 10. foo 4171 4172 bar 4173"###, 4174 &danger 4175 )?, 4176 r###"<ol start="10"> 4177<li> 4178<p>foo</p> 4179<pre><code>bar 4180</code></pre> 4181</li> 4182</ol> 4183"###, 4184 r###"List items (271)"### 4185); 4186 4187 assert_eq!( 4188 to_html_with_options( 4189 r###" indented code 4190 4191paragraph 4192 4193 more code 4194"###, 4195 &danger 4196 )?, 4197 r###"<pre><code>indented code 4198</code></pre> 4199<p>paragraph</p> 4200<pre><code>more code 4201</code></pre> 4202"###, 4203 r###"List items (272)"### 4204); 4205 4206 assert_eq!( 4207 to_html_with_options( 4208 r###"1. indented code 4209 4210 paragraph 4211 4212 more code 4213"###, 4214 &danger 4215 )?, 4216 r###"<ol> 4217<li> 4218<pre><code>indented code 4219</code></pre> 4220<p>paragraph</p> 4221<pre><code>more code 4222</code></pre> 4223</li> 4224</ol> 4225"###, 4226 r###"List items (273)"### 4227); 4228 4229 assert_eq!( 4230 to_html_with_options( 4231 r###"1. indented code 4232 4233 paragraph 4234 4235 more code 4236"###, 4237 &danger 4238 )?, 4239 r###"<ol> 4240<li> 4241<pre><code> indented code 4242</code></pre> 4243<p>paragraph</p> 4244<pre><code>more code 4245</code></pre> 4246</li> 4247</ol> 4248"###, 4249 r###"List items (274)"### 4250); 4251 4252 assert_eq!( 4253 to_html_with_options( 4254 r###" foo 4255 4256bar 4257"###, 4258 &danger 4259 )?, 4260 r###"<p>foo</p> 4261<p>bar</p> 4262"###, 4263 r###"List items (275)"### 4264); 4265 4266 assert_eq!( 4267 to_html_with_options( 4268 r###"- foo 4269 4270 bar 4271"###, 4272 &danger 4273 )?, 4274 r###"<ul> 4275<li>foo</li> 4276</ul> 4277<p>bar</p> 4278"###, 4279 r###"List items (276)"### 4280); 4281 4282 assert_eq!( 4283 to_html_with_options( 4284 r###"- foo 4285 4286 bar 4287"###, 4288 &danger 4289 )?, 4290 r###"<ul> 4291<li> 4292<p>foo</p> 4293<p>bar</p> 4294</li> 4295</ul> 4296"###, 4297 r###"List items (277)"### 4298); 4299 4300 assert_eq!( 4301 to_html_with_options( 4302 r###"- 4303 foo 4304- 4305 ``` 4306 bar 4307 ``` 4308- 4309 baz 4310"###, 4311 &danger 4312 )?, 4313 r###"<ul> 4314<li>foo</li> 4315<li> 4316<pre><code>bar 4317</code></pre> 4318</li> 4319<li> 4320<pre><code>baz 4321</code></pre> 4322</li> 4323</ul> 4324"###, 4325 r###"List items (278)"### 4326); 4327 4328 assert_eq!( 4329 to_html_with_options( 4330 r###"- 4331 foo 4332"###, 4333 &danger 4334 )?, 4335 r###"<ul> 4336<li>foo</li> 4337</ul> 4338"###, 4339 r###"List items (279)"### 4340); 4341 4342 assert_eq!( 4343 to_html_with_options( 4344 r###"- 4345 4346 foo 4347"###, 4348 &danger 4349 )?, 4350 r###"<ul> 4351<li></li> 4352</ul> 4353<p>foo</p> 4354"###, 4355 r###"List items (280)"### 4356); 4357 4358 assert_eq!( 4359 to_html_with_options( 4360 r###"- foo 4361- 4362- bar 4363"###, 4364 &danger 4365 )?, 4366 r###"<ul> 4367<li>foo</li> 4368<li></li> 4369<li>bar</li> 4370</ul> 4371"###, 4372 r###"List items (281)"### 4373); 4374 4375 assert_eq!( 4376 to_html_with_options( 4377 r###"- foo 4378- 4379- bar 4380"###, 4381 &danger 4382 )?, 4383 r###"<ul> 4384<li>foo</li> 4385<li></li> 4386<li>bar</li> 4387</ul> 4388"###, 4389 r###"List items (282)"### 4390); 4391 4392 assert_eq!( 4393 to_html_with_options( 4394 r###"1. foo 43952. 43963. bar 4397"###, 4398 &danger 4399 )?, 4400 r###"<ol> 4401<li>foo</li> 4402<li></li> 4403<li>bar</li> 4404</ol> 4405"###, 4406 r###"List items (283)"### 4407); 4408 4409 assert_eq!( 4410 to_html_with_options( 4411 r###"* 4412"###, 4413 &danger 4414 )?, 4415 r###"<ul> 4416<li></li> 4417</ul> 4418"###, 4419 r###"List items (284)"### 4420); 4421 4422 assert_eq!( 4423 to_html_with_options( 4424 r###"foo 4425* 4426 4427foo 44281. 4429"###, 4430 &danger 4431 )?, 4432 r###"<p>foo 4433*</p> 4434<p>foo 44351.</p> 4436"###, 4437 r###"List items (285)"### 4438); 4439 4440 assert_eq!( 4441 to_html_with_options( 4442 r###" 1. A paragraph 4443 with two lines. 4444 4445 indented code 4446 4447 > A block quote. 4448"###, 4449 &danger 4450 )?, 4451 r###"<ol> 4452<li> 4453<p>A paragraph 4454with two lines.</p> 4455<pre><code>indented code 4456</code></pre> 4457<blockquote> 4458<p>A block quote.</p> 4459</blockquote> 4460</li> 4461</ol> 4462"###, 4463 r###"List items (286)"### 4464); 4465 4466 assert_eq!( 4467 to_html_with_options( 4468 r###" 1. A paragraph 4469 with two lines. 4470 4471 indented code 4472 4473 > A block quote. 4474"###, 4475 &danger 4476 )?, 4477 r###"<ol> 4478<li> 4479<p>A paragraph 4480with two lines.</p> 4481<pre><code>indented code 4482</code></pre> 4483<blockquote> 4484<p>A block quote.</p> 4485</blockquote> 4486</li> 4487</ol> 4488"###, 4489 r###"List items (287)"### 4490); 4491 4492 assert_eq!( 4493 to_html_with_options( 4494 r###" 1. A paragraph 4495 with two lines. 4496 4497 indented code 4498 4499 > A block quote. 4500"###, 4501 &danger 4502 )?, 4503 r###"<ol> 4504<li> 4505<p>A paragraph 4506with two lines.</p> 4507<pre><code>indented code 4508</code></pre> 4509<blockquote> 4510<p>A block quote.</p> 4511</blockquote> 4512</li> 4513</ol> 4514"###, 4515 r###"List items (288)"### 4516); 4517 4518 assert_eq!( 4519 to_html_with_options( 4520 r###" 1. A paragraph 4521 with two lines. 4522 4523 indented code 4524 4525 > A block quote. 4526"###, 4527 &danger 4528 )?, 4529 r###"<pre><code>1. A paragraph 4530 with two lines. 4531 4532 indented code 4533 4534 &gt; A block quote. 4535</code></pre> 4536"###, 4537 r###"List items (289)"### 4538); 4539 4540 assert_eq!( 4541 to_html_with_options( 4542 r###" 1. A paragraph 4543with two lines. 4544 4545 indented code 4546 4547 > A block quote. 4548"###, 4549 &danger 4550 )?, 4551 r###"<ol> 4552<li> 4553<p>A paragraph 4554with two lines.</p> 4555<pre><code>indented code 4556</code></pre> 4557<blockquote> 4558<p>A block quote.</p> 4559</blockquote> 4560</li> 4561</ol> 4562"###, 4563 r###"List items (290)"### 4564); 4565 4566 assert_eq!( 4567 to_html_with_options( 4568 r###" 1. A paragraph 4569 with two lines. 4570"###, 4571 &danger 4572 )?, 4573 r###"<ol> 4574<li>A paragraph 4575with two lines.</li> 4576</ol> 4577"###, 4578 r###"List items (291)"### 4579); 4580 4581 assert_eq!( 4582 to_html_with_options( 4583 r###"> 1. > Blockquote 4584continued here. 4585"###, 4586 &danger 4587 )?, 4588 r###"<blockquote> 4589<ol> 4590<li> 4591<blockquote> 4592<p>Blockquote 4593continued here.</p> 4594</blockquote> 4595</li> 4596</ol> 4597</blockquote> 4598"###, 4599 r###"List items (292)"### 4600); 4601 4602 assert_eq!( 4603 to_html_with_options( 4604 r###"> 1. > Blockquote 4605> continued here. 4606"###, 4607 &danger 4608 )?, 4609 r###"<blockquote> 4610<ol> 4611<li> 4612<blockquote> 4613<p>Blockquote 4614continued here.</p> 4615</blockquote> 4616</li> 4617</ol> 4618</blockquote> 4619"###, 4620 r###"List items (293)"### 4621); 4622 4623 assert_eq!( 4624 to_html_with_options( 4625 r###"- foo 4626 - bar 4627 - baz 4628 - boo 4629"###, 4630 &danger 4631 )?, 4632 r###"<ul> 4633<li>foo 4634<ul> 4635<li>bar 4636<ul> 4637<li>baz 4638<ul> 4639<li>boo</li> 4640</ul> 4641</li> 4642</ul> 4643</li> 4644</ul> 4645</li> 4646</ul> 4647"###, 4648 r###"List items (294)"### 4649); 4650 4651 assert_eq!( 4652 to_html_with_options( 4653 r###"- foo 4654 - bar 4655 - baz 4656 - boo 4657"###, 4658 &danger 4659 )?, 4660 r###"<ul> 4661<li>foo</li> 4662<li>bar</li> 4663<li>baz</li> 4664<li>boo</li> 4665</ul> 4666"###, 4667 r###"List items (295)"### 4668); 4669 4670 assert_eq!( 4671 to_html_with_options( 4672 r###"10) foo 4673 - bar 4674"###, 4675 &danger 4676 )?, 4677 r###"<ol start="10"> 4678<li>foo 4679<ul> 4680<li>bar</li> 4681</ul> 4682</li> 4683</ol> 4684"###, 4685 r###"List items (296)"### 4686); 4687 4688 assert_eq!( 4689 to_html_with_options( 4690 r###"10) foo 4691 - bar 4692"###, 4693 &danger 4694 )?, 4695 r###"<ol start="10"> 4696<li>foo</li> 4697</ol> 4698<ul> 4699<li>bar</li> 4700</ul> 4701"###, 4702 r###"List items (297)"### 4703); 4704 4705 assert_eq!( 4706 to_html_with_options( 4707 r###"- - foo 4708"###, 4709 &danger 4710 )?, 4711 r###"<ul> 4712<li> 4713<ul> 4714<li>foo</li> 4715</ul> 4716</li> 4717</ul> 4718"###, 4719 r###"List items (298)"### 4720); 4721 4722 assert_eq!( 4723 to_html_with_options( 4724 r###"1. - 2. foo 4725"###, 4726 &danger 4727 )?, 4728 r###"<ol> 4729<li> 4730<ul> 4731<li> 4732<ol start="2"> 4733<li>foo</li> 4734</ol> 4735</li> 4736</ul> 4737</li> 4738</ol> 4739"###, 4740 r###"List items (299)"### 4741); 4742 4743 assert_eq!( 4744 to_html_with_options( 4745 r###"- # Foo 4746- Bar 4747 --- 4748 baz 4749"###, 4750 &danger 4751 )?, 4752 r###"<ul> 4753<li> 4754<h1>Foo</h1> 4755</li> 4756<li> 4757<h2>Bar</h2> 4758baz</li> 4759</ul> 4760"###, 4761 r###"List items (300)"### 4762); 4763 4764 assert_eq!( 4765 to_html_with_options( 4766 r###"- foo 4767- bar 4768+ baz 4769"###, 4770 &danger 4771 )?, 4772 r###"<ul> 4773<li>foo</li> 4774<li>bar</li> 4775</ul> 4776<ul> 4777<li>baz</li> 4778</ul> 4779"###, 4780 r###"Lists (301)"### 4781); 4782 4783 assert_eq!( 4784 to_html_with_options( 4785 r###"1. foo 47862. bar 47873) baz 4788"###, 4789 &danger 4790 )?, 4791 r###"<ol> 4792<li>foo</li> 4793<li>bar</li> 4794</ol> 4795<ol start="3"> 4796<li>baz</li> 4797</ol> 4798"###, 4799 r###"Lists (302)"### 4800); 4801 4802 assert_eq!( 4803 to_html_with_options( 4804 r###"Foo 4805- bar 4806- baz 4807"###, 4808 &danger 4809 )?, 4810 r###"<p>Foo</p> 4811<ul> 4812<li>bar</li> 4813<li>baz</li> 4814</ul> 4815"###, 4816 r###"Lists (303)"### 4817); 4818 4819 assert_eq!( 4820 to_html_with_options( 4821 r###"The number of windows in my house is 482214. The number of doors is 6. 4823"###, 4824 &danger 4825 )?, 4826 r###"<p>The number of windows in my house is 482714. The number of doors is 6.</p> 4828"###, 4829 r###"Lists (304)"### 4830); 4831 4832 assert_eq!( 4833 to_html_with_options( 4834 r###"The number of windows in my house is 48351. The number of doors is 6. 4836"###, 4837 &danger 4838 )?, 4839 r###"<p>The number of windows in my house is</p> 4840<ol> 4841<li>The number of doors is 6.</li> 4842</ol> 4843"###, 4844 r###"Lists (305)"### 4845); 4846 4847 assert_eq!( 4848 to_html_with_options( 4849 r###"- foo 4850 4851- bar 4852 4853 4854- baz 4855"###, 4856 &danger 4857 )?, 4858 r###"<ul> 4859<li> 4860<p>foo</p> 4861</li> 4862<li> 4863<p>bar</p> 4864</li> 4865<li> 4866<p>baz</p> 4867</li> 4868</ul> 4869"###, 4870 r###"Lists (306)"### 4871); 4872 4873 assert_eq!( 4874 to_html_with_options( 4875 r###"- foo 4876 - bar 4877 - baz 4878 4879 4880 bim 4881"###, 4882 &danger 4883 )?, 4884 r###"<ul> 4885<li>foo 4886<ul> 4887<li>bar 4888<ul> 4889<li> 4890<p>baz</p> 4891<p>bim</p> 4892</li> 4893</ul> 4894</li> 4895</ul> 4896</li> 4897</ul> 4898"###, 4899 r###"Lists (307)"### 4900); 4901 4902 assert_eq!( 4903 to_html_with_options( 4904 r###"- foo 4905- bar 4906 4907<!-- --> 4908 4909- baz 4910- bim 4911"###, 4912 &danger 4913 )?, 4914 r###"<ul> 4915<li>foo</li> 4916<li>bar</li> 4917</ul> 4918<!-- --> 4919<ul> 4920<li>baz</li> 4921<li>bim</li> 4922</ul> 4923"###, 4924 r###"Lists (308)"### 4925); 4926 4927 assert_eq!( 4928 to_html_with_options( 4929 r###"- foo 4930 4931 notcode 4932 4933- foo 4934 4935<!-- --> 4936 4937 code 4938"###, 4939 &danger 4940 )?, 4941 r###"<ul> 4942<li> 4943<p>foo</p> 4944<p>notcode</p> 4945</li> 4946<li> 4947<p>foo</p> 4948</li> 4949</ul> 4950<!-- --> 4951<pre><code>code 4952</code></pre> 4953"###, 4954 r###"Lists (309)"### 4955); 4956 4957 assert_eq!( 4958 to_html_with_options( 4959 r###"- a 4960 - b 4961 - c 4962 - d 4963 - e 4964 - f 4965- g 4966"###, 4967 &danger 4968 )?, 4969 r###"<ul> 4970<li>a</li> 4971<li>b</li> 4972<li>c</li> 4973<li>d</li> 4974<li>e</li> 4975<li>f</li> 4976<li>g</li> 4977</ul> 4978"###, 4979 r###"Lists (310)"### 4980); 4981 4982 assert_eq!( 4983 to_html_with_options( 4984 r###"1. a 4985 4986 2. b 4987 4988 3. c 4989"###, 4990 &danger 4991 )?, 4992 r###"<ol> 4993<li> 4994<p>a</p> 4995</li> 4996<li> 4997<p>b</p> 4998</li> 4999<li> 5000<p>c</p> 5001</li> 5002</ol> 5003"###, 5004 r###"Lists (311)"### 5005); 5006 5007 assert_eq!( 5008 to_html_with_options( 5009 r###"- a 5010 - b 5011 - c 5012 - d 5013 - e 5014"###, 5015 &danger 5016 )?, 5017 r###"<ul> 5018<li>a</li> 5019<li>b</li> 5020<li>c</li> 5021<li>d 5022- e</li> 5023</ul> 5024"###, 5025 r###"Lists (312)"### 5026); 5027 5028 assert_eq!( 5029 to_html_with_options( 5030 r###"1. a 5031 5032 2. b 5033 5034 3. c 5035"###, 5036 &danger 5037 )?, 5038 r###"<ol> 5039<li> 5040<p>a</p> 5041</li> 5042<li> 5043<p>b</p> 5044</li> 5045</ol> 5046<pre><code>3. c 5047</code></pre> 5048"###, 5049 r###"Lists (313)"### 5050); 5051 5052 assert_eq!( 5053 to_html_with_options( 5054 r###"- a 5055- b 5056 5057- c 5058"###, 5059 &danger 5060 )?, 5061 r###"<ul> 5062<li> 5063<p>a</p> 5064</li> 5065<li> 5066<p>b</p> 5067</li> 5068<li> 5069<p>c</p> 5070</li> 5071</ul> 5072"###, 5073 r###"Lists (314)"### 5074); 5075 5076 assert_eq!( 5077 to_html_with_options( 5078 r###"* a 5079* 5080 5081* c 5082"###, 5083 &danger 5084 )?, 5085 r###"<ul> 5086<li> 5087<p>a</p> 5088</li> 5089<li></li> 5090<li> 5091<p>c</p> 5092</li> 5093</ul> 5094"###, 5095 r###"Lists (315)"### 5096); 5097 5098 assert_eq!( 5099 to_html_with_options( 5100 r###"- a 5101- b 5102 5103 c 5104- d 5105"###, 5106 &danger 5107 )?, 5108 r###"<ul> 5109<li> 5110<p>a</p> 5111</li> 5112<li> 5113<p>b</p> 5114<p>c</p> 5115</li> 5116<li> 5117<p>d</p> 5118</li> 5119</ul> 5120"###, 5121 r###"Lists (316)"### 5122); 5123 5124 assert_eq!( 5125 to_html_with_options( 5126 r###"- a 5127- b 5128 5129 [ref]: /url 5130- d 5131"###, 5132 &danger 5133 )?, 5134 r###"<ul> 5135<li> 5136<p>a</p> 5137</li> 5138<li> 5139<p>b</p> 5140</li> 5141<li> 5142<p>d</p> 5143</li> 5144</ul> 5145"###, 5146 r###"Lists (317)"### 5147); 5148 5149 assert_eq!( 5150 to_html_with_options( 5151 r###"- a 5152- ``` 5153 b 5154 5155 5156 ``` 5157- c 5158"###, 5159 &danger 5160 )?, 5161 r###"<ul> 5162<li>a</li> 5163<li> 5164<pre><code>b 5165 5166 5167</code></pre> 5168</li> 5169<li>c</li> 5170</ul> 5171"###, 5172 r###"Lists (318)"### 5173); 5174 5175 assert_eq!( 5176 to_html_with_options( 5177 r###"- a 5178 - b 5179 5180 c 5181- d 5182"###, 5183 &danger 5184 )?, 5185 r###"<ul> 5186<li>a 5187<ul> 5188<li> 5189<p>b</p> 5190<p>c</p> 5191</li> 5192</ul> 5193</li> 5194<li>d</li> 5195</ul> 5196"###, 5197 r###"Lists (319)"### 5198); 5199 5200 assert_eq!( 5201 to_html_with_options( 5202 r###"* a 5203 > b 5204 > 5205* c 5206"###, 5207 &danger 5208 )?, 5209 r###"<ul> 5210<li>a 5211<blockquote> 5212<p>b</p> 5213</blockquote> 5214</li> 5215<li>c</li> 5216</ul> 5217"###, 5218 r###"Lists (320)"### 5219); 5220 5221 assert_eq!( 5222 to_html_with_options( 5223 r###"- a 5224 > b 5225 ``` 5226 c 5227 ``` 5228- d 5229"###, 5230 &danger 5231 )?, 5232 r###"<ul> 5233<li>a 5234<blockquote> 5235<p>b</p> 5236</blockquote> 5237<pre><code>c 5238</code></pre> 5239</li> 5240<li>d</li> 5241</ul> 5242"###, 5243 r###"Lists (321)"### 5244); 5245 5246 assert_eq!( 5247 to_html_with_options( 5248 r###"- a 5249"###, 5250 &danger 5251 )?, 5252 r###"<ul> 5253<li>a</li> 5254</ul> 5255"###, 5256 r###"Lists (322)"### 5257); 5258 5259 assert_eq!( 5260 to_html_with_options( 5261 r###"- a 5262 - b 5263"###, 5264 &danger 5265 )?, 5266 r###"<ul> 5267<li>a 5268<ul> 5269<li>b</li> 5270</ul> 5271</li> 5272</ul> 5273"###, 5274 r###"Lists (323)"### 5275); 5276 5277 assert_eq!( 5278 to_html_with_options( 5279 r###"1. ``` 5280 foo 5281 ``` 5282 5283 bar 5284"###, 5285 &danger 5286 )?, 5287 r###"<ol> 5288<li> 5289<pre><code>foo 5290</code></pre> 5291<p>bar</p> 5292</li> 5293</ol> 5294"###, 5295 r###"Lists (324)"### 5296); 5297 5298 assert_eq!( 5299 to_html_with_options( 5300 r###"* foo 5301 * bar 5302 5303 baz 5304"###, 5305 &danger 5306 )?, 5307 r###"<ul> 5308<li> 5309<p>foo</p> 5310<ul> 5311<li>bar</li> 5312</ul> 5313<p>baz</p> 5314</li> 5315</ul> 5316"###, 5317 r###"Lists (325)"### 5318); 5319 5320 assert_eq!( 5321 to_html_with_options( 5322 r###"- a 5323 - b 5324 - c 5325 5326- d 5327 - e 5328 - f 5329"###, 5330 &danger 5331 )?, 5332 r###"<ul> 5333<li> 5334<p>a</p> 5335<ul> 5336<li>b</li> 5337<li>c</li> 5338</ul> 5339</li> 5340<li> 5341<p>d</p> 5342<ul> 5343<li>e</li> 5344<li>f</li> 5345</ul> 5346</li> 5347</ul> 5348"###, 5349 r###"Lists (326)"### 5350); 5351 5352 assert_eq!( 5353 to_html_with_options( 5354 r###"`hi`lo` 5355"###, 5356 &danger 5357 )?, 5358 r###"<p><code>hi</code>lo`</p> 5359"###, 5360 r###"Inlines (327)"### 5361); 5362 5363 assert_eq!( 5364 to_html_with_options( 5365 r###"`foo` 5366"###, 5367 &danger 5368 )?, 5369 r###"<p><code>foo</code></p> 5370"###, 5371 r###"Code spans (328)"### 5372); 5373 5374 assert_eq!( 5375 to_html_with_options( 5376 r###"`` foo ` bar `` 5377"###, 5378 &danger 5379 )?, 5380 r###"<p><code>foo ` bar</code></p> 5381"###, 5382 r###"Code spans (329)"### 5383); 5384 5385 assert_eq!( 5386 to_html_with_options( 5387 r###"` `` ` 5388"###, 5389 &danger 5390 )?, 5391 r###"<p><code>``</code></p> 5392"###, 5393 r###"Code spans (330)"### 5394); 5395 5396 assert_eq!( 5397 to_html_with_options( 5398 r###"` `` ` 5399"###, 5400 &danger 5401 )?, 5402 r###"<p><code> `` </code></p> 5403"###, 5404 r###"Code spans (331)"### 5405); 5406 5407 assert_eq!( 5408 to_html_with_options( 5409 r###"` a` 5410"###, 5411 &danger 5412 )?, 5413 r###"<p><code> a</code></p> 5414"###, 5415 r###"Code spans (332)"### 5416); 5417 5418 assert_eq!( 5419 to_html_with_options( 5420 r###"` b ` 5421"###, 5422 &danger 5423 )?, 5424 r###"<p><code> b </code></p> 5425"###, 5426 r###"Code spans (333)"### 5427); 5428 5429 assert_eq!( 5430 to_html_with_options( 5431 r###"` ` 5432` ` 5433"###, 5434 &danger 5435 )?, 5436 r###"<p><code> </code> 5437<code> </code></p> 5438"###, 5439 r###"Code spans (334)"### 5440); 5441 5442 assert_eq!( 5443 to_html_with_options( 5444 r###"`` 5445foo 5446bar 5447baz 5448`` 5449"###, 5450 &danger 5451 )?, 5452 r###"<p><code>foo bar baz</code></p> 5453"###, 5454 r###"Code spans (335)"### 5455); 5456 5457 assert_eq!( 5458 to_html_with_options( 5459 r###"`` 5460foo 5461`` 5462"###, 5463 &danger 5464 )?, 5465 r###"<p><code>foo </code></p> 5466"###, 5467 r###"Code spans (336)"### 5468); 5469 5470 assert_eq!( 5471 to_html_with_options( 5472 r###"`foo bar 5473baz` 5474"###, 5475 &danger 5476 )?, 5477 r###"<p><code>foo bar baz</code></p> 5478"###, 5479 r###"Code spans (337)"### 5480); 5481 5482 assert_eq!( 5483 to_html_with_options( 5484 r###"`foo\`bar` 5485"###, 5486 &danger 5487 )?, 5488 r###"<p><code>foo\</code>bar`</p> 5489"###, 5490 r###"Code spans (338)"### 5491); 5492 5493 assert_eq!( 5494 to_html_with_options( 5495 r###"``foo`bar`` 5496"###, 5497 &danger 5498 )?, 5499 r###"<p><code>foo`bar</code></p> 5500"###, 5501 r###"Code spans (339)"### 5502); 5503 5504 assert_eq!( 5505 to_html_with_options( 5506 r###"` foo `` bar ` 5507"###, 5508 &danger 5509 )?, 5510 r###"<p><code>foo `` bar</code></p> 5511"###, 5512 r###"Code spans (340)"### 5513); 5514 5515 assert_eq!( 5516 to_html_with_options( 5517 r###"*foo`*` 5518"###, 5519 &danger 5520 )?, 5521 r###"<p>*foo<code>*</code></p> 5522"###, 5523 r###"Code spans (341)"### 5524); 5525 5526 assert_eq!( 5527 to_html_with_options( 5528 r###"[not a `link](/foo`) 5529"###, 5530 &danger 5531 )?, 5532 r###"<p>[not a <code>link](/foo</code>)</p> 5533"###, 5534 r###"Code spans (342)"### 5535); 5536 5537 assert_eq!( 5538 to_html_with_options( 5539 r###"`<a href="`">` 5540"###, 5541 &danger 5542 )?, 5543 r###"<p><code>&lt;a href=&quot;</code>&quot;&gt;`</p> 5544"###, 5545 r###"Code spans (343)"### 5546); 5547 5548 assert_eq!( 5549 to_html_with_options( 5550 r###"<a href="`">` 5551"###, 5552 &danger 5553 )?, 5554 r###"<p><a href="`">`</p> 5555"###, 5556 r###"Code spans (344)"### 5557); 5558 5559 assert_eq!( 5560 to_html_with_options( 5561 r###"`<https://foo.bar.`baz>` 5562"###, 5563 &danger 5564 )?, 5565 r###"<p><code>&lt;https://foo.bar.</code>baz&gt;`</p> 5566"###, 5567 r###"Code spans (345)"### 5568); 5569 5570 assert_eq!( 5571 to_html_with_options( 5572 r###"<https://foo.bar.`baz>` 5573"###, 5574 &danger 5575 )?, 5576 r###"<p><a href="https://foo.bar.%60baz">https://foo.bar.`baz</a>`</p> 5577"###, 5578 r###"Code spans (346)"### 5579); 5580 5581 assert_eq!( 5582 to_html_with_options( 5583 r###"```foo`` 5584"###, 5585 &danger 5586 )?, 5587 r###"<p>```foo``</p> 5588"###, 5589 r###"Code spans (347)"### 5590); 5591 5592 assert_eq!( 5593 to_html_with_options( 5594 r###"`foo 5595"###, 5596 &danger 5597 )?, 5598 r###"<p>`foo</p> 5599"###, 5600 r###"Code spans (348)"### 5601); 5602 5603 assert_eq!( 5604 to_html_with_options( 5605 r###"`foo``bar`` 5606"###, 5607 &danger 5608 )?, 5609 r###"<p>`foo<code>bar</code></p> 5610"###, 5611 r###"Code spans (349)"### 5612); 5613 5614 assert_eq!( 5615 to_html_with_options( 5616 r###"*foo bar* 5617"###, 5618 &danger 5619 )?, 5620 r###"<p><em>foo bar</em></p> 5621"###, 5622 r###"Emphasis and strong emphasis (350)"### 5623); 5624 5625 assert_eq!( 5626 to_html_with_options( 5627 r###"a * foo bar* 5628"###, 5629 &danger 5630 )?, 5631 r###"<p>a * foo bar*</p> 5632"###, 5633 r###"Emphasis and strong emphasis (351)"### 5634); 5635 5636 assert_eq!( 5637 to_html_with_options( 5638 r###"a*"foo"* 5639"###, 5640 &danger 5641 )?, 5642 r###"<p>a*&quot;foo&quot;*</p> 5643"###, 5644 r###"Emphasis and strong emphasis (352)"### 5645); 5646 5647 assert_eq!( 5648 to_html_with_options( 5649 r###"* a * 5650"###, 5651 &danger 5652 )?, 5653 r###"<p>* a *</p> 5654"###, 5655 r###"Emphasis and strong emphasis (353)"### 5656); 5657 5658 assert_eq!( 5659 to_html_with_options( 5660 r###"*$*alpha. 5661 5662*£*bravo. 5663 5664*€*charlie. 5665"###, 5666 &danger 5667 )?, 5668 r###"<p>*$*alpha.</p> 5669<p>*£*bravo.</p> 5670<p>*€*charlie.</p> 5671"###, 5672 r###"Emphasis and strong emphasis (354)"### 5673); 5674 5675 assert_eq!( 5676 to_html_with_options( 5677 r###"foo*bar* 5678"###, 5679 &danger 5680 )?, 5681 r###"<p>foo<em>bar</em></p> 5682"###, 5683 r###"Emphasis and strong emphasis (355)"### 5684); 5685 5686 assert_eq!( 5687 to_html_with_options( 5688 r###"5*6*78 5689"###, 5690 &danger 5691 )?, 5692 r###"<p>5<em>6</em>78</p> 5693"###, 5694 r###"Emphasis and strong emphasis (356)"### 5695); 5696 5697 assert_eq!( 5698 to_html_with_options( 5699 r###"_foo bar_ 5700"###, 5701 &danger 5702 )?, 5703 r###"<p><em>foo bar</em></p> 5704"###, 5705 r###"Emphasis and strong emphasis (357)"### 5706); 5707 5708 assert_eq!( 5709 to_html_with_options( 5710 r###"_ foo bar_ 5711"###, 5712 &danger 5713 )?, 5714 r###"<p>_ foo bar_</p> 5715"###, 5716 r###"Emphasis and strong emphasis (358)"### 5717); 5718 5719 assert_eq!( 5720 to_html_with_options( 5721 r###"a_"foo"_ 5722"###, 5723 &danger 5724 )?, 5725 r###"<p>a_&quot;foo&quot;_</p> 5726"###, 5727 r###"Emphasis and strong emphasis (359)"### 5728); 5729 5730 assert_eq!( 5731 to_html_with_options( 5732 r###"foo_bar_ 5733"###, 5734 &danger 5735 )?, 5736 r###"<p>foo_bar_</p> 5737"###, 5738 r###"Emphasis and strong emphasis (360)"### 5739); 5740 5741 assert_eq!( 5742 to_html_with_options( 5743 r###"5_6_78 5744"###, 5745 &danger 5746 )?, 5747 r###"<p>5_6_78</p> 5748"###, 5749 r###"Emphasis and strong emphasis (361)"### 5750); 5751 5752 assert_eq!( 5753 to_html_with_options( 5754 r###"пристаням_стремятся_ 5755"###, 5756 &danger 5757 )?, 5758 r###"<p>пристаням_стремятся_</p> 5759"###, 5760 r###"Emphasis and strong emphasis (362)"### 5761); 5762 5763 assert_eq!( 5764 to_html_with_options( 5765 r###"aa_"bb"_cc 5766"###, 5767 &danger 5768 )?, 5769 r###"<p>aa_&quot;bb&quot;_cc</p> 5770"###, 5771 r###"Emphasis and strong emphasis (363)"### 5772); 5773 5774 assert_eq!( 5775 to_html_with_options( 5776 r###"foo-_(bar)_ 5777"###, 5778 &danger 5779 )?, 5780 r###"<p>foo-<em>(bar)</em></p> 5781"###, 5782 r###"Emphasis and strong emphasis (364)"### 5783); 5784 5785 assert_eq!( 5786 to_html_with_options( 5787 r###"_foo* 5788"###, 5789 &danger 5790 )?, 5791 r###"<p>_foo*</p> 5792"###, 5793 r###"Emphasis and strong emphasis (365)"### 5794); 5795 5796 assert_eq!( 5797 to_html_with_options( 5798 r###"*foo bar * 5799"###, 5800 &danger 5801 )?, 5802 r###"<p>*foo bar *</p> 5803"###, 5804 r###"Emphasis and strong emphasis (366)"### 5805); 5806 5807 assert_eq!( 5808 to_html_with_options( 5809 r###"*foo bar 5810* 5811"###, 5812 &danger 5813 )?, 5814 r###"<p>*foo bar 5815*</p> 5816"###, 5817 r###"Emphasis and strong emphasis (367)"### 5818); 5819 5820 assert_eq!( 5821 to_html_with_options( 5822 r###"*(*foo) 5823"###, 5824 &danger 5825 )?, 5826 r###"<p>*(*foo)</p> 5827"###, 5828 r###"Emphasis and strong emphasis (368)"### 5829); 5830 5831 assert_eq!( 5832 to_html_with_options( 5833 r###"*(*foo*)* 5834"###, 5835 &danger 5836 )?, 5837 r###"<p><em>(<em>foo</em>)</em></p> 5838"###, 5839 r###"Emphasis and strong emphasis (369)"### 5840); 5841 5842 assert_eq!( 5843 to_html_with_options( 5844 r###"*foo*bar 5845"###, 5846 &danger 5847 )?, 5848 r###"<p><em>foo</em>bar</p> 5849"###, 5850 r###"Emphasis and strong emphasis (370)"### 5851); 5852 5853 assert_eq!( 5854 to_html_with_options( 5855 r###"_foo bar _ 5856"###, 5857 &danger 5858 )?, 5859 r###"<p>_foo bar _</p> 5860"###, 5861 r###"Emphasis and strong emphasis (371)"### 5862); 5863 5864 assert_eq!( 5865 to_html_with_options( 5866 r###"_(_foo) 5867"###, 5868 &danger 5869 )?, 5870 r###"<p>_(_foo)</p> 5871"###, 5872 r###"Emphasis and strong emphasis (372)"### 5873); 5874 5875 assert_eq!( 5876 to_html_with_options( 5877 r###"_(_foo_)_ 5878"###, 5879 &danger 5880 )?, 5881 r###"<p><em>(<em>foo</em>)</em></p> 5882"###, 5883 r###"Emphasis and strong emphasis (373)"### 5884); 5885 5886 assert_eq!( 5887 to_html_with_options( 5888 r###"_foo_bar 5889"###, 5890 &danger 5891 )?, 5892 r###"<p>_foo_bar</p> 5893"###, 5894 r###"Emphasis and strong emphasis (374)"### 5895); 5896 5897 assert_eq!( 5898 to_html_with_options( 5899 r###"_пристаням_стремятся 5900"###, 5901 &danger 5902 )?, 5903 r###"<p>_пристаням_стремятся</p> 5904"###, 5905 r###"Emphasis and strong emphasis (375)"### 5906); 5907 5908 assert_eq!( 5909 to_html_with_options( 5910 r###"_foo_bar_baz_ 5911"###, 5912 &danger 5913 )?, 5914 r###"<p><em>foo_bar_baz</em></p> 5915"###, 5916 r###"Emphasis and strong emphasis (376)"### 5917); 5918 5919 assert_eq!( 5920 to_html_with_options( 5921 r###"_(bar)_. 5922"###, 5923 &danger 5924 )?, 5925 r###"<p><em>(bar)</em>.</p> 5926"###, 5927 r###"Emphasis and strong emphasis (377)"### 5928); 5929 5930 assert_eq!( 5931 to_html_with_options( 5932 r###"**foo bar** 5933"###, 5934 &danger 5935 )?, 5936 r###"<p><strong>foo bar</strong></p> 5937"###, 5938 r###"Emphasis and strong emphasis (378)"### 5939); 5940 5941 assert_eq!( 5942 to_html_with_options( 5943 r###"** foo bar** 5944"###, 5945 &danger 5946 )?, 5947 r###"<p>** foo bar**</p> 5948"###, 5949 r###"Emphasis and strong emphasis (379)"### 5950); 5951 5952 assert_eq!( 5953 to_html_with_options( 5954 r###"a**"foo"** 5955"###, 5956 &danger 5957 )?, 5958 r###"<p>a**&quot;foo&quot;**</p> 5959"###, 5960 r###"Emphasis and strong emphasis (380)"### 5961); 5962 5963 assert_eq!( 5964 to_html_with_options( 5965 r###"foo**bar** 5966"###, 5967 &danger 5968 )?, 5969 r###"<p>foo<strong>bar</strong></p> 5970"###, 5971 r###"Emphasis and strong emphasis (381)"### 5972); 5973 5974 assert_eq!( 5975 to_html_with_options( 5976 r###"__foo bar__ 5977"###, 5978 &danger 5979 )?, 5980 r###"<p><strong>foo bar</strong></p> 5981"###, 5982 r###"Emphasis and strong emphasis (382)"### 5983); 5984 5985 assert_eq!( 5986 to_html_with_options( 5987 r###"__ foo bar__ 5988"###, 5989 &danger 5990 )?, 5991 r###"<p>__ foo bar__</p> 5992"###, 5993 r###"Emphasis and strong emphasis (383)"### 5994); 5995 5996 assert_eq!( 5997 to_html_with_options( 5998 r###"__ 5999foo bar__ 6000"###, 6001 &danger 6002 )?, 6003 r###"<p>__ 6004foo bar__</p> 6005"###, 6006 r###"Emphasis and strong emphasis (384)"### 6007); 6008 6009 assert_eq!( 6010 to_html_with_options( 6011 r###"a__"foo"__ 6012"###, 6013 &danger 6014 )?, 6015 r###"<p>a__&quot;foo&quot;__</p> 6016"###, 6017 r###"Emphasis and strong emphasis (385)"### 6018); 6019 6020 assert_eq!( 6021 to_html_with_options( 6022 r###"foo__bar__ 6023"###, 6024 &danger 6025 )?, 6026 r###"<p>foo__bar__</p> 6027"###, 6028 r###"Emphasis and strong emphasis (386)"### 6029); 6030 6031 assert_eq!( 6032 to_html_with_options( 6033 r###"5__6__78 6034"###, 6035 &danger 6036 )?, 6037 r###"<p>5__6__78</p> 6038"###, 6039 r###"Emphasis and strong emphasis (387)"### 6040); 6041 6042 assert_eq!( 6043 to_html_with_options( 6044 r###"пристаням__стремятся__ 6045"###, 6046 &danger 6047 )?, 6048 r###"<p>пристаням__стремятся__</p> 6049"###, 6050 r###"Emphasis and strong emphasis (388)"### 6051); 6052 6053 assert_eq!( 6054 to_html_with_options( 6055 r###"__foo, __bar__, baz__ 6056"###, 6057 &danger 6058 )?, 6059 r###"<p><strong>foo, <strong>bar</strong>, baz</strong></p> 6060"###, 6061 r###"Emphasis and strong emphasis (389)"### 6062); 6063 6064 assert_eq!( 6065 to_html_with_options( 6066 r###"foo-__(bar)__ 6067"###, 6068 &danger 6069 )?, 6070 r###"<p>foo-<strong>(bar)</strong></p> 6071"###, 6072 r###"Emphasis and strong emphasis (390)"### 6073); 6074 6075 assert_eq!( 6076 to_html_with_options( 6077 r###"**foo bar ** 6078"###, 6079 &danger 6080 )?, 6081 r###"<p>**foo bar **</p> 6082"###, 6083 r###"Emphasis and strong emphasis (391)"### 6084); 6085 6086 assert_eq!( 6087 to_html_with_options( 6088 r###"**(**foo) 6089"###, 6090 &danger 6091 )?, 6092 r###"<p>**(**foo)</p> 6093"###, 6094 r###"Emphasis and strong emphasis (392)"### 6095); 6096 6097 assert_eq!( 6098 to_html_with_options( 6099 r###"*(**foo**)* 6100"###, 6101 &danger 6102 )?, 6103 r###"<p><em>(<strong>foo</strong>)</em></p> 6104"###, 6105 r###"Emphasis and strong emphasis (393)"### 6106); 6107 6108 assert_eq!( 6109 to_html_with_options( 6110 r###"**Gomphocarpus (*Gomphocarpus physocarpus*, syn. 6111*Asclepias physocarpa*)** 6112"###, 6113 &danger 6114 )?, 6115 r###"<p><strong>Gomphocarpus (<em>Gomphocarpus physocarpus</em>, syn. 6116<em>Asclepias physocarpa</em>)</strong></p> 6117"###, 6118 r###"Emphasis and strong emphasis (394)"### 6119); 6120 6121 assert_eq!( 6122 to_html_with_options( 6123 r###"**foo "*bar*" foo** 6124"###, 6125 &danger 6126 )?, 6127 r###"<p><strong>foo &quot;<em>bar</em>&quot; foo</strong></p> 6128"###, 6129 r###"Emphasis and strong emphasis (395)"### 6130); 6131 6132 assert_eq!( 6133 to_html_with_options( 6134 r###"**foo**bar 6135"###, 6136 &danger 6137 )?, 6138 r###"<p><strong>foo</strong>bar</p> 6139"###, 6140 r###"Emphasis and strong emphasis (396)"### 6141); 6142 6143 assert_eq!( 6144 to_html_with_options( 6145 r###"__foo bar __ 6146"###, 6147 &danger 6148 )?, 6149 r###"<p>__foo bar __</p> 6150"###, 6151 r###"Emphasis and strong emphasis (397)"### 6152); 6153 6154 assert_eq!( 6155 to_html_with_options( 6156 r###"__(__foo) 6157"###, 6158 &danger 6159 )?, 6160 r###"<p>__(__foo)</p> 6161"###, 6162 r###"Emphasis and strong emphasis (398)"### 6163); 6164 6165 assert_eq!( 6166 to_html_with_options( 6167 r###"_(__foo__)_ 6168"###, 6169 &danger 6170 )?, 6171 r###"<p><em>(<strong>foo</strong>)</em></p> 6172"###, 6173 r###"Emphasis and strong emphasis (399)"### 6174); 6175 6176 assert_eq!( 6177 to_html_with_options( 6178 r###"__foo__bar 6179"###, 6180 &danger 6181 )?, 6182 r###"<p>__foo__bar</p> 6183"###, 6184 r###"Emphasis and strong emphasis (400)"### 6185); 6186 6187 assert_eq!( 6188 to_html_with_options( 6189 r###"__пристаням__стремятся 6190"###, 6191 &danger 6192 )?, 6193 r###"<p>__пристаням__стремятся</p> 6194"###, 6195 r###"Emphasis and strong emphasis (401)"### 6196); 6197 6198 assert_eq!( 6199 to_html_with_options( 6200 r###"__foo__bar__baz__ 6201"###, 6202 &danger 6203 )?, 6204 r###"<p><strong>foo__bar__baz</strong></p> 6205"###, 6206 r###"Emphasis and strong emphasis (402)"### 6207); 6208 6209 assert_eq!( 6210 to_html_with_options( 6211 r###"__(bar)__. 6212"###, 6213 &danger 6214 )?, 6215 r###"<p><strong>(bar)</strong>.</p> 6216"###, 6217 r###"Emphasis and strong emphasis (403)"### 6218); 6219 6220 assert_eq!( 6221 to_html_with_options( 6222 r###"*foo [bar](/url)* 6223"###, 6224 &danger 6225 )?, 6226 r###"<p><em>foo <a href="/url">bar</a></em></p> 6227"###, 6228 r###"Emphasis and strong emphasis (404)"### 6229); 6230 6231 assert_eq!( 6232 to_html_with_options( 6233 r###"*foo 6234bar* 6235"###, 6236 &danger 6237 )?, 6238 r###"<p><em>foo 6239bar</em></p> 6240"###, 6241 r###"Emphasis and strong emphasis (405)"### 6242); 6243 6244 assert_eq!( 6245 to_html_with_options( 6246 r###"_foo __bar__ baz_ 6247"###, 6248 &danger 6249 )?, 6250 r###"<p><em>foo <strong>bar</strong> baz</em></p> 6251"###, 6252 r###"Emphasis and strong emphasis (406)"### 6253); 6254 6255 assert_eq!( 6256 to_html_with_options( 6257 r###"_foo _bar_ baz_ 6258"###, 6259 &danger 6260 )?, 6261 r###"<p><em>foo <em>bar</em> baz</em></p> 6262"###, 6263 r###"Emphasis and strong emphasis (407)"### 6264); 6265 6266 assert_eq!( 6267 to_html_with_options( 6268 r###"__foo_ bar_ 6269"###, 6270 &danger 6271 )?, 6272 r###"<p><em><em>foo</em> bar</em></p> 6273"###, 6274 r###"Emphasis and strong emphasis (408)"### 6275); 6276 6277 assert_eq!( 6278 to_html_with_options( 6279 r###"*foo *bar** 6280"###, 6281 &danger 6282 )?, 6283 r###"<p><em>foo <em>bar</em></em></p> 6284"###, 6285 r###"Emphasis and strong emphasis (409)"### 6286); 6287 6288 assert_eq!( 6289 to_html_with_options( 6290 r###"*foo **bar** baz* 6291"###, 6292 &danger 6293 )?, 6294 r###"<p><em>foo <strong>bar</strong> baz</em></p> 6295"###, 6296 r###"Emphasis and strong emphasis (410)"### 6297); 6298 6299 assert_eq!( 6300 to_html_with_options( 6301 r###"*foo**bar**baz* 6302"###, 6303 &danger 6304 )?, 6305 r###"<p><em>foo<strong>bar</strong>baz</em></p> 6306"###, 6307 r###"Emphasis and strong emphasis (411)"### 6308); 6309 6310 assert_eq!( 6311 to_html_with_options( 6312 r###"*foo**bar* 6313"###, 6314 &danger 6315 )?, 6316 r###"<p><em>foo**bar</em></p> 6317"###, 6318 r###"Emphasis and strong emphasis (412)"### 6319); 6320 6321 assert_eq!( 6322 to_html_with_options( 6323 r###"***foo** bar* 6324"###, 6325 &danger 6326 )?, 6327 r###"<p><em><strong>foo</strong> bar</em></p> 6328"###, 6329 r###"Emphasis and strong emphasis (413)"### 6330); 6331 6332 assert_eq!( 6333 to_html_with_options( 6334 r###"*foo **bar*** 6335"###, 6336 &danger 6337 )?, 6338 r###"<p><em>foo <strong>bar</strong></em></p> 6339"###, 6340 r###"Emphasis and strong emphasis (414)"### 6341); 6342 6343 assert_eq!( 6344 to_html_with_options( 6345 r###"*foo**bar*** 6346"###, 6347 &danger 6348 )?, 6349 r###"<p><em>foo<strong>bar</strong></em></p> 6350"###, 6351 r###"Emphasis and strong emphasis (415)"### 6352); 6353 6354 assert_eq!( 6355 to_html_with_options( 6356 r###"foo***bar***baz 6357"###, 6358 &danger 6359 )?, 6360 r###"<p>foo<em><strong>bar</strong></em>baz</p> 6361"###, 6362 r###"Emphasis and strong emphasis (416)"### 6363); 6364 6365 assert_eq!( 6366 to_html_with_options( 6367 r###"foo******bar*********baz 6368"###, 6369 &danger 6370 )?, 6371 r###"<p>foo<strong><strong><strong>bar</strong></strong></strong>***baz</p> 6372"###, 6373 r###"Emphasis and strong emphasis (417)"### 6374); 6375 6376 assert_eq!( 6377 to_html_with_options( 6378 r###"*foo **bar *baz* bim** bop* 6379"###, 6380 &danger 6381 )?, 6382 r###"<p><em>foo <strong>bar <em>baz</em> bim</strong> bop</em></p> 6383"###, 6384 r###"Emphasis and strong emphasis (418)"### 6385); 6386 6387 assert_eq!( 6388 to_html_with_options( 6389 r###"*foo [*bar*](/url)* 6390"###, 6391 &danger 6392 )?, 6393 r###"<p><em>foo <a href="/url"><em>bar</em></a></em></p> 6394"###, 6395 r###"Emphasis and strong emphasis (419)"### 6396); 6397 6398 assert_eq!( 6399 to_html_with_options( 6400 r###"** is not an empty emphasis 6401"###, 6402 &danger 6403 )?, 6404 r###"<p>** is not an empty emphasis</p> 6405"###, 6406 r###"Emphasis and strong emphasis (420)"### 6407); 6408 6409 assert_eq!( 6410 to_html_with_options( 6411 r###"**** is not an empty strong emphasis 6412"###, 6413 &danger 6414 )?, 6415 r###"<p>**** is not an empty strong emphasis</p> 6416"###, 6417 r###"Emphasis and strong emphasis (421)"### 6418); 6419 6420 assert_eq!( 6421 to_html_with_options( 6422 r###"**foo [bar](/url)** 6423"###, 6424 &danger 6425 )?, 6426 r###"<p><strong>foo <a href="/url">bar</a></strong></p> 6427"###, 6428 r###"Emphasis and strong emphasis (422)"### 6429); 6430 6431 assert_eq!( 6432 to_html_with_options( 6433 r###"**foo 6434bar** 6435"###, 6436 &danger 6437 )?, 6438 r###"<p><strong>foo 6439bar</strong></p> 6440"###, 6441 r###"Emphasis and strong emphasis (423)"### 6442); 6443 6444 assert_eq!( 6445 to_html_with_options( 6446 r###"__foo _bar_ baz__ 6447"###, 6448 &danger 6449 )?, 6450 r###"<p><strong>foo <em>bar</em> baz</strong></p> 6451"###, 6452 r###"Emphasis and strong emphasis (424)"### 6453); 6454 6455 assert_eq!( 6456 to_html_with_options( 6457 r###"__foo __bar__ baz__ 6458"###, 6459 &danger 6460 )?, 6461 r###"<p><strong>foo <strong>bar</strong> baz</strong></p> 6462"###, 6463 r###"Emphasis and strong emphasis (425)"### 6464); 6465 6466 assert_eq!( 6467 to_html_with_options( 6468 r###"____foo__ bar__ 6469"###, 6470 &danger 6471 )?, 6472 r###"<p><strong><strong>foo</strong> bar</strong></p> 6473"###, 6474 r###"Emphasis and strong emphasis (426)"### 6475); 6476 6477 assert_eq!( 6478 to_html_with_options( 6479 r###"**foo **bar**** 6480"###, 6481 &danger 6482 )?, 6483 r###"<p><strong>foo <strong>bar</strong></strong></p> 6484"###, 6485 r###"Emphasis and strong emphasis (427)"### 6486); 6487 6488 assert_eq!( 6489 to_html_with_options( 6490 r###"**foo *bar* baz** 6491"###, 6492 &danger 6493 )?, 6494 r###"<p><strong>foo <em>bar</em> baz</strong></p> 6495"###, 6496 r###"Emphasis and strong emphasis (428)"### 6497); 6498 6499 assert_eq!( 6500 to_html_with_options( 6501 r###"**foo*bar*baz** 6502"###, 6503 &danger 6504 )?, 6505 r###"<p><strong>foo<em>bar</em>baz</strong></p> 6506"###, 6507 r###"Emphasis and strong emphasis (429)"### 6508); 6509 6510 assert_eq!( 6511 to_html_with_options( 6512 r###"***foo* bar** 6513"###, 6514 &danger 6515 )?, 6516 r###"<p><strong><em>foo</em> bar</strong></p> 6517"###, 6518 r###"Emphasis and strong emphasis (430)"### 6519); 6520 6521 assert_eq!( 6522 to_html_with_options( 6523 r###"**foo *bar*** 6524"###, 6525 &danger 6526 )?, 6527 r###"<p><strong>foo <em>bar</em></strong></p> 6528"###, 6529 r###"Emphasis and strong emphasis (431)"### 6530); 6531 6532 assert_eq!( 6533 to_html_with_options( 6534 r###"**foo *bar **baz** 6535bim* bop** 6536"###, 6537 &danger 6538 )?, 6539 r###"<p><strong>foo <em>bar <strong>baz</strong> 6540bim</em> bop</strong></p> 6541"###, 6542 r###"Emphasis and strong emphasis (432)"### 6543); 6544 6545 assert_eq!( 6546 to_html_with_options( 6547 r###"**foo [*bar*](/url)** 6548"###, 6549 &danger 6550 )?, 6551 r###"<p><strong>foo <a href="/url"><em>bar</em></a></strong></p> 6552"###, 6553 r###"Emphasis and strong emphasis (433)"### 6554); 6555 6556 assert_eq!( 6557 to_html_with_options( 6558 r###"__ is not an empty emphasis 6559"###, 6560 &danger 6561 )?, 6562 r###"<p>__ is not an empty emphasis</p> 6563"###, 6564 r###"Emphasis and strong emphasis (434)"### 6565); 6566 6567 assert_eq!( 6568 to_html_with_options( 6569 r###"____ is not an empty strong emphasis 6570"###, 6571 &danger 6572 )?, 6573 r###"<p>____ is not an empty strong emphasis</p> 6574"###, 6575 r###"Emphasis and strong emphasis (435)"### 6576); 6577 6578 assert_eq!( 6579 to_html_with_options( 6580 r###"foo *** 6581"###, 6582 &danger 6583 )?, 6584 r###"<p>foo ***</p> 6585"###, 6586 r###"Emphasis and strong emphasis (436)"### 6587); 6588 6589 assert_eq!( 6590 to_html_with_options( 6591 r###"foo *\** 6592"###, 6593 &danger 6594 )?, 6595 r###"<p>foo <em>*</em></p> 6596"###, 6597 r###"Emphasis and strong emphasis (437)"### 6598); 6599 6600 assert_eq!( 6601 to_html_with_options( 6602 r###"foo *_* 6603"###, 6604 &danger 6605 )?, 6606 r###"<p>foo <em>_</em></p> 6607"###, 6608 r###"Emphasis and strong emphasis (438)"### 6609); 6610 6611 assert_eq!( 6612 to_html_with_options( 6613 r###"foo ***** 6614"###, 6615 &danger 6616 )?, 6617 r###"<p>foo *****</p> 6618"###, 6619 r###"Emphasis and strong emphasis (439)"### 6620); 6621 6622 assert_eq!( 6623 to_html_with_options( 6624 r###"foo **\*** 6625"###, 6626 &danger 6627 )?, 6628 r###"<p>foo <strong>*</strong></p> 6629"###, 6630 r###"Emphasis and strong emphasis (440)"### 6631); 6632 6633 assert_eq!( 6634 to_html_with_options( 6635 r###"foo **_** 6636"###, 6637 &danger 6638 )?, 6639 r###"<p>foo <strong>_</strong></p> 6640"###, 6641 r###"Emphasis and strong emphasis (441)"### 6642); 6643 6644 assert_eq!( 6645 to_html_with_options( 6646 r###"**foo* 6647"###, 6648 &danger 6649 )?, 6650 r###"<p>*<em>foo</em></p> 6651"###, 6652 r###"Emphasis and strong emphasis (442)"### 6653); 6654 6655 assert_eq!( 6656 to_html_with_options( 6657 r###"*foo** 6658"###, 6659 &danger 6660 )?, 6661 r###"<p><em>foo</em>*</p> 6662"###, 6663 r###"Emphasis and strong emphasis (443)"### 6664); 6665 6666 assert_eq!( 6667 to_html_with_options( 6668 r###"***foo** 6669"###, 6670 &danger 6671 )?, 6672 r###"<p>*<strong>foo</strong></p> 6673"###, 6674 r###"Emphasis and strong emphasis (444)"### 6675); 6676 6677 assert_eq!( 6678 to_html_with_options( 6679 r###"****foo* 6680"###, 6681 &danger 6682 )?, 6683 r###"<p>***<em>foo</em></p> 6684"###, 6685 r###"Emphasis and strong emphasis (445)"### 6686); 6687 6688 assert_eq!( 6689 to_html_with_options( 6690 r###"**foo*** 6691"###, 6692 &danger 6693 )?, 6694 r###"<p><strong>foo</strong>*</p> 6695"###, 6696 r###"Emphasis and strong emphasis (446)"### 6697); 6698 6699 assert_eq!( 6700 to_html_with_options( 6701 r###"*foo**** 6702"###, 6703 &danger 6704 )?, 6705 r###"<p><em>foo</em>***</p> 6706"###, 6707 r###"Emphasis and strong emphasis (447)"### 6708); 6709 6710 assert_eq!( 6711 to_html_with_options( 6712 r###"foo ___ 6713"###, 6714 &danger 6715 )?, 6716 r###"<p>foo ___</p> 6717"###, 6718 r###"Emphasis and strong emphasis (448)"### 6719); 6720 6721 assert_eq!( 6722 to_html_with_options( 6723 r###"foo _\__ 6724"###, 6725 &danger 6726 )?, 6727 r###"<p>foo <em>_</em></p> 6728"###, 6729 r###"Emphasis and strong emphasis (449)"### 6730); 6731 6732 assert_eq!( 6733 to_html_with_options( 6734 r###"foo _*_ 6735"###, 6736 &danger 6737 )?, 6738 r###"<p>foo <em>*</em></p> 6739"###, 6740 r###"Emphasis and strong emphasis (450)"### 6741); 6742 6743 assert_eq!( 6744 to_html_with_options( 6745 r###"foo _____ 6746"###, 6747 &danger 6748 )?, 6749 r###"<p>foo _____</p> 6750"###, 6751 r###"Emphasis and strong emphasis (451)"### 6752); 6753 6754 assert_eq!( 6755 to_html_with_options( 6756 r###"foo __\___ 6757"###, 6758 &danger 6759 )?, 6760 r###"<p>foo <strong>_</strong></p> 6761"###, 6762 r###"Emphasis and strong emphasis (452)"### 6763); 6764 6765 assert_eq!( 6766 to_html_with_options( 6767 r###"foo __*__ 6768"###, 6769 &danger 6770 )?, 6771 r###"<p>foo <strong>*</strong></p> 6772"###, 6773 r###"Emphasis and strong emphasis (453)"### 6774); 6775 6776 assert_eq!( 6777 to_html_with_options( 6778 r###"__foo_ 6779"###, 6780 &danger 6781 )?, 6782 r###"<p>_<em>foo</em></p> 6783"###, 6784 r###"Emphasis and strong emphasis (454)"### 6785); 6786 6787 assert_eq!( 6788 to_html_with_options( 6789 r###"_foo__ 6790"###, 6791 &danger 6792 )?, 6793 r###"<p><em>foo</em>_</p> 6794"###, 6795 r###"Emphasis and strong emphasis (455)"### 6796); 6797 6798 assert_eq!( 6799 to_html_with_options( 6800 r###"___foo__ 6801"###, 6802 &danger 6803 )?, 6804 r###"<p>_<strong>foo</strong></p> 6805"###, 6806 r###"Emphasis and strong emphasis (456)"### 6807); 6808 6809 assert_eq!( 6810 to_html_with_options( 6811 r###"____foo_ 6812"###, 6813 &danger 6814 )?, 6815 r###"<p>___<em>foo</em></p> 6816"###, 6817 r###"Emphasis and strong emphasis (457)"### 6818); 6819 6820 assert_eq!( 6821 to_html_with_options( 6822 r###"__foo___ 6823"###, 6824 &danger 6825 )?, 6826 r###"<p><strong>foo</strong>_</p> 6827"###, 6828 r###"Emphasis and strong emphasis (458)"### 6829); 6830 6831 assert_eq!( 6832 to_html_with_options( 6833 r###"_foo____ 6834"###, 6835 &danger 6836 )?, 6837 r###"<p><em>foo</em>___</p> 6838"###, 6839 r###"Emphasis and strong emphasis (459)"### 6840); 6841 6842 assert_eq!( 6843 to_html_with_options( 6844 r###"**foo** 6845"###, 6846 &danger 6847 )?, 6848 r###"<p><strong>foo</strong></p> 6849"###, 6850 r###"Emphasis and strong emphasis (460)"### 6851); 6852 6853 assert_eq!( 6854 to_html_with_options( 6855 r###"*_foo_* 6856"###, 6857 &danger 6858 )?, 6859 r###"<p><em><em>foo</em></em></p> 6860"###, 6861 r###"Emphasis and strong emphasis (461)"### 6862); 6863 6864 assert_eq!( 6865 to_html_with_options( 6866 r###"__foo__ 6867"###, 6868 &danger 6869 )?, 6870 r###"<p><strong>foo</strong></p> 6871"###, 6872 r###"Emphasis and strong emphasis (462)"### 6873); 6874 6875 assert_eq!( 6876 to_html_with_options( 6877 r###"_*foo*_ 6878"###, 6879 &danger 6880 )?, 6881 r###"<p><em><em>foo</em></em></p> 6882"###, 6883 r###"Emphasis and strong emphasis (463)"### 6884); 6885 6886 assert_eq!( 6887 to_html_with_options( 6888 r###"****foo**** 6889"###, 6890 &danger 6891 )?, 6892 r###"<p><strong><strong>foo</strong></strong></p> 6893"###, 6894 r###"Emphasis and strong emphasis (464)"### 6895); 6896 6897 assert_eq!( 6898 to_html_with_options( 6899 r###"____foo____ 6900"###, 6901 &danger 6902 )?, 6903 r###"<p><strong><strong>foo</strong></strong></p> 6904"###, 6905 r###"Emphasis and strong emphasis (465)"### 6906); 6907 6908 assert_eq!( 6909 to_html_with_options( 6910 r###"******foo****** 6911"###, 6912 &danger 6913 )?, 6914 r###"<p><strong><strong><strong>foo</strong></strong></strong></p> 6915"###, 6916 r###"Emphasis and strong emphasis (466)"### 6917); 6918 6919 assert_eq!( 6920 to_html_with_options( 6921 r###"***foo*** 6922"###, 6923 &danger 6924 )?, 6925 r###"<p><em><strong>foo</strong></em></p> 6926"###, 6927 r###"Emphasis and strong emphasis (467)"### 6928); 6929 6930 assert_eq!( 6931 to_html_with_options( 6932 r###"_____foo_____ 6933"###, 6934 &danger 6935 )?, 6936 r###"<p><em><strong><strong>foo</strong></strong></em></p> 6937"###, 6938 r###"Emphasis and strong emphasis (468)"### 6939); 6940 6941 assert_eq!( 6942 to_html_with_options( 6943 r###"*foo _bar* baz_ 6944"###, 6945 &danger 6946 )?, 6947 r###"<p><em>foo _bar</em> baz_</p> 6948"###, 6949 r###"Emphasis and strong emphasis (469)"### 6950); 6951 6952 assert_eq!( 6953 to_html_with_options( 6954 r###"*foo __bar *baz bim__ bam* 6955"###, 6956 &danger 6957 )?, 6958 r###"<p><em>foo <strong>bar *baz bim</strong> bam</em></p> 6959"###, 6960 r###"Emphasis and strong emphasis (470)"### 6961); 6962 6963 assert_eq!( 6964 to_html_with_options( 6965 r###"**foo **bar baz** 6966"###, 6967 &danger 6968 )?, 6969 r###"<p>**foo <strong>bar baz</strong></p> 6970"###, 6971 r###"Emphasis and strong emphasis (471)"### 6972); 6973 6974 assert_eq!( 6975 to_html_with_options( 6976 r###"*foo *bar baz* 6977"###, 6978 &danger 6979 )?, 6980 r###"<p>*foo <em>bar baz</em></p> 6981"###, 6982 r###"Emphasis and strong emphasis (472)"### 6983); 6984 6985 assert_eq!( 6986 to_html_with_options( 6987 r###"*[bar*](/url) 6988"###, 6989 &danger 6990 )?, 6991 r###"<p>*<a href="/url">bar*</a></p> 6992"###, 6993 r###"Emphasis and strong emphasis (473)"### 6994); 6995 6996 assert_eq!( 6997 to_html_with_options( 6998 r###"_foo [bar_](/url) 6999"###, 7000 &danger 7001 )?, 7002 r###"<p>_foo <a href="/url">bar_</a></p> 7003"###, 7004 r###"Emphasis and strong emphasis (474)"### 7005); 7006 7007 assert_eq!( 7008 to_html_with_options( 7009 r###"*<img src="foo" title="*"/> 7010"###, 7011 &danger 7012 )?, 7013 r###"<p>*<img src="foo" title="*"/></p> 7014"###, 7015 r###"Emphasis and strong emphasis (475)"### 7016); 7017 7018 assert_eq!( 7019 to_html_with_options( 7020 r###"**<a href="**"> 7021"###, 7022 &danger 7023 )?, 7024 r###"<p>**<a href="**"></p> 7025"###, 7026 r###"Emphasis and strong emphasis (476)"### 7027); 7028 7029 assert_eq!( 7030 to_html_with_options( 7031 r###"__<a href="__"> 7032"###, 7033 &danger 7034 )?, 7035 r###"<p>__<a href="__"></p> 7036"###, 7037 r###"Emphasis and strong emphasis (477)"### 7038); 7039 7040 assert_eq!( 7041 to_html_with_options( 7042 r###"*a `*`* 7043"###, 7044 &danger 7045 )?, 7046 r###"<p><em>a <code>*</code></em></p> 7047"###, 7048 r###"Emphasis and strong emphasis (478)"### 7049); 7050 7051 assert_eq!( 7052 to_html_with_options( 7053 r###"_a `_`_ 7054"###, 7055 &danger 7056 )?, 7057 r###"<p><em>a <code>_</code></em></p> 7058"###, 7059 r###"Emphasis and strong emphasis (479)"### 7060); 7061 7062 assert_eq!( 7063 to_html_with_options( 7064 r###"**a<https://foo.bar/?q=**> 7065"###, 7066 &danger 7067 )?, 7068 r###"<p>**a<a href="https://foo.bar/?q=**">https://foo.bar/?q=**</a></p> 7069"###, 7070 r###"Emphasis and strong emphasis (480)"### 7071); 7072 7073 assert_eq!( 7074 to_html_with_options( 7075 r###"__a<https://foo.bar/?q=__> 7076"###, 7077 &danger 7078 )?, 7079 r###"<p>__a<a href="https://foo.bar/?q=__">https://foo.bar/?q=__</a></p> 7080"###, 7081 r###"Emphasis and strong emphasis (481)"### 7082); 7083 7084 assert_eq!( 7085 to_html_with_options( 7086 r###"[link](/uri "title") 7087"###, 7088 &danger 7089 )?, 7090 r###"<p><a href="/uri" title="title">link</a></p> 7091"###, 7092 r###"Links (482)"### 7093); 7094 7095 assert_eq!( 7096 to_html_with_options( 7097 r###"[link](/uri) 7098"###, 7099 &danger 7100 )?, 7101 r###"<p><a href="/uri">link</a></p> 7102"###, 7103 r###"Links (483)"### 7104); 7105 7106 assert_eq!( 7107 to_html_with_options( 7108 r###"[](./target.md) 7109"###, 7110 &danger 7111 )?, 7112 r###"<p><a href="./target.md"></a></p> 7113"###, 7114 r###"Links (484)"### 7115); 7116 7117 assert_eq!( 7118 to_html_with_options( 7119 r###"[link]() 7120"###, 7121 &danger 7122 )?, 7123 r###"<p><a href="">link</a></p> 7124"###, 7125 r###"Links (485)"### 7126); 7127 7128 assert_eq!( 7129 to_html_with_options( 7130 r###"[link](<>) 7131"###, 7132 &danger 7133 )?, 7134 r###"<p><a href="">link</a></p> 7135"###, 7136 r###"Links (486)"### 7137); 7138 7139 assert_eq!( 7140 to_html_with_options( 7141 r###"[]() 7142"###, 7143 &danger 7144 )?, 7145 r###"<p><a href=""></a></p> 7146"###, 7147 r###"Links (487)"### 7148); 7149 7150 assert_eq!( 7151 to_html_with_options( 7152 r###"[link](/my uri) 7153"###, 7154 &danger 7155 )?, 7156 r###"<p>[link](/my uri)</p> 7157"###, 7158 r###"Links (488)"### 7159); 7160 7161 assert_eq!( 7162 to_html_with_options( 7163 r###"[link](</my uri>) 7164"###, 7165 &danger 7166 )?, 7167 r###"<p><a href="/my%20uri">link</a></p> 7168"###, 7169 r###"Links (489)"### 7170); 7171 7172 assert_eq!( 7173 to_html_with_options( 7174 r###"[link](foo 7175bar) 7176"###, 7177 &danger 7178 )?, 7179 r###"<p>[link](foo 7180bar)</p> 7181"###, 7182 r###"Links (490)"### 7183); 7184 7185 assert_eq!( 7186 to_html_with_options( 7187 r###"[link](<foo 7188bar>) 7189"###, 7190 &danger 7191 )?, 7192 r###"<p>[link](<foo 7193bar>)</p> 7194"###, 7195 r###"Links (491)"### 7196); 7197 7198 assert_eq!( 7199 to_html_with_options( 7200 r###"[a](<b)c>) 7201"###, 7202 &danger 7203 )?, 7204 r###"<p><a href="b)c">a</a></p> 7205"###, 7206 r###"Links (492)"### 7207); 7208 7209 assert_eq!( 7210 to_html_with_options( 7211 r###"[link](<foo\>) 7212"###, 7213 &danger 7214 )?, 7215 r###"<p>[link](&lt;foo&gt;)</p> 7216"###, 7217 r###"Links (493)"### 7218); 7219 7220 assert_eq!( 7221 to_html_with_options( 7222 r###"[a](<b)c 7223[a](<b)c> 7224[a](<b>c) 7225"###, 7226 &danger 7227 )?, 7228 r###"<p>[a](&lt;b)c 7229[a](&lt;b)c&gt; 7230[a](<b>c)</p> 7231"###, 7232 r###"Links (494)"### 7233); 7234 7235 assert_eq!( 7236 to_html_with_options( 7237 r###"[link](\(foo\)) 7238"###, 7239 &danger 7240 )?, 7241 r###"<p><a href="(foo)">link</a></p> 7242"###, 7243 r###"Links (495)"### 7244); 7245 7246 assert_eq!( 7247 to_html_with_options( 7248 r###"[link](foo(and(bar))) 7249"###, 7250 &danger 7251 )?, 7252 r###"<p><a href="foo(and(bar))">link</a></p> 7253"###, 7254 r###"Links (496)"### 7255); 7256 7257 assert_eq!( 7258 to_html_with_options( 7259 r###"[link](foo(and(bar)) 7260"###, 7261 &danger 7262 )?, 7263 r###"<p>[link](foo(and(bar))</p> 7264"###, 7265 r###"Links (497)"### 7266); 7267 7268 assert_eq!( 7269 to_html_with_options( 7270 r###"[link](foo\(and\(bar\)) 7271"###, 7272 &danger 7273 )?, 7274 r###"<p><a href="foo(and(bar)">link</a></p> 7275"###, 7276 r###"Links (498)"### 7277); 7278 7279 assert_eq!( 7280 to_html_with_options( 7281 r###"[link](<foo(and(bar)>) 7282"###, 7283 &danger 7284 )?, 7285 r###"<p><a href="foo(and(bar)">link</a></p> 7286"###, 7287 r###"Links (499)"### 7288); 7289 7290 assert_eq!( 7291 to_html_with_options( 7292 r###"[link](foo\)\:) 7293"###, 7294 &danger 7295 )?, 7296 r###"<p><a href="foo):">link</a></p> 7297"###, 7298 r###"Links (500)"### 7299); 7300 7301 assert_eq!( 7302 to_html_with_options( 7303 r###"[link](#fragment) 7304 7305[link](https://example.com#fragment) 7306 7307[link](https://example.com?foo=3#frag) 7308"###, 7309 &danger 7310 )?, 7311 r###"<p><a href="#fragment">link</a></p> 7312<p><a href="https://example.com#fragment">link</a></p> 7313<p><a href="https://example.com?foo=3#frag">link</a></p> 7314"###, 7315 r###"Links (501)"### 7316); 7317 7318 assert_eq!( 7319 to_html_with_options( 7320 r###"[link](foo\bar) 7321"###, 7322 &danger 7323 )?, 7324 r###"<p><a href="foo%5Cbar">link</a></p> 7325"###, 7326 r###"Links (502)"### 7327); 7328 7329 assert_eq!( 7330 to_html_with_options( 7331 r###"[link](foo%20b&auml;) 7332"###, 7333 &danger 7334 )?, 7335 r###"<p><a href="foo%20b%C3%A4">link</a></p> 7336"###, 7337 r###"Links (503)"### 7338); 7339 7340 assert_eq!( 7341 to_html_with_options( 7342 r###"[link]("title") 7343"###, 7344 &danger 7345 )?, 7346 r###"<p><a href="%22title%22">link</a></p> 7347"###, 7348 r###"Links (504)"### 7349); 7350 7351 assert_eq!( 7352 to_html_with_options( 7353 r###"[link](/url "title") 7354[link](/url 'title') 7355[link](/url (title)) 7356"###, 7357 &danger 7358 )?, 7359 r###"<p><a href="/url" title="title">link</a> 7360<a href="/url" title="title">link</a> 7361<a href="/url" title="title">link</a></p> 7362"###, 7363 r###"Links (505)"### 7364); 7365 7366 assert_eq!( 7367 to_html_with_options( 7368 r###"[link](/url "title \"&quot;") 7369"###, 7370 &danger 7371 )?, 7372 r###"<p><a href="/url" title="title &quot;&quot;">link</a></p> 7373"###, 7374 r###"Links (506)"### 7375); 7376 7377 assert_eq!( 7378 to_html_with_options( 7379 r###"[link](/url "title") 7380"###, 7381 &danger 7382 )?, 7383 r###"<p><a href="/url%C2%A0%22title%22">link</a></p> 7384"###, 7385 r###"Links (507)"### 7386); 7387 7388 assert_eq!( 7389 to_html_with_options( 7390 r###"[link](/url "title "and" title") 7391"###, 7392 &danger 7393 )?, 7394 r###"<p>[link](/url &quot;title &quot;and&quot; title&quot;)</p> 7395"###, 7396 r###"Links (508)"### 7397); 7398 7399 assert_eq!( 7400 to_html_with_options( 7401 r###"[link](/url 'title "and" title') 7402"###, 7403 &danger 7404 )?, 7405 r###"<p><a href="/url" title="title &quot;and&quot; title">link</a></p> 7406"###, 7407 r###"Links (509)"### 7408); 7409 7410 assert_eq!( 7411 to_html_with_options( 7412 r###"[link]( /uri 7413 "title" ) 7414"###, 7415 &danger 7416 )?, 7417 r###"<p><a href="/uri" title="title">link</a></p> 7418"###, 7419 r###"Links (510)"### 7420); 7421 7422 assert_eq!( 7423 to_html_with_options( 7424 r###"[link] (/uri) 7425"###, 7426 &danger 7427 )?, 7428 r###"<p>[link] (/uri)</p> 7429"###, 7430 r###"Links (511)"### 7431); 7432 7433 assert_eq!( 7434 to_html_with_options( 7435 r###"[link [foo [bar]]](/uri) 7436"###, 7437 &danger 7438 )?, 7439 r###"<p><a href="/uri">link [foo [bar]]</a></p> 7440"###, 7441 r###"Links (512)"### 7442); 7443 7444 assert_eq!( 7445 to_html_with_options( 7446 r###"[link] bar](/uri) 7447"###, 7448 &danger 7449 )?, 7450 r###"<p>[link] bar](/uri)</p> 7451"###, 7452 r###"Links (513)"### 7453); 7454 7455 assert_eq!( 7456 to_html_with_options( 7457 r###"[link [bar](/uri) 7458"###, 7459 &danger 7460 )?, 7461 r###"<p>[link <a href="/uri">bar</a></p> 7462"###, 7463 r###"Links (514)"### 7464); 7465 7466 assert_eq!( 7467 to_html_with_options( 7468 r###"[link \[bar](/uri) 7469"###, 7470 &danger 7471 )?, 7472 r###"<p><a href="/uri">link [bar</a></p> 7473"###, 7474 r###"Links (515)"### 7475); 7476 7477 assert_eq!( 7478 to_html_with_options( 7479 r###"[link *foo **bar** `#`*](/uri) 7480"###, 7481 &danger 7482 )?, 7483 r###"<p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p> 7484"###, 7485 r###"Links (516)"### 7486); 7487 7488 assert_eq!( 7489 to_html_with_options( 7490 r###"[![moon](moon.jpg)](/uri) 7491"###, 7492 &danger 7493 )?, 7494 r###"<p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p> 7495"###, 7496 r###"Links (517)"### 7497); 7498 7499 assert_eq!( 7500 to_html_with_options( 7501 r###"[foo [bar](/uri)](/uri) 7502"###, 7503 &danger 7504 )?, 7505 r###"<p>[foo <a href="/uri">bar</a>](/uri)</p> 7506"###, 7507 r###"Links (518)"### 7508); 7509 7510 assert_eq!( 7511 to_html_with_options( 7512 r###"[foo *[bar [baz](/uri)](/uri)*](/uri) 7513"###, 7514 &danger 7515 )?, 7516 r###"<p>[foo <em>[bar <a href="/uri">baz</a>](/uri)</em>](/uri)</p> 7517"###, 7518 r###"Links (519)"### 7519); 7520 7521 assert_eq!( 7522 to_html_with_options( 7523 r###"![[[foo](uri1)](uri2)](uri3) 7524"###, 7525 &danger 7526 )?, 7527 r###"<p><img src="uri3" alt="[foo](uri2)" /></p> 7528"###, 7529 r###"Links (520)"### 7530); 7531 7532 assert_eq!( 7533 to_html_with_options( 7534 r###"*[foo*](/uri) 7535"###, 7536 &danger 7537 )?, 7538 r###"<p>*<a href="/uri">foo*</a></p> 7539"###, 7540 r###"Links (521)"### 7541); 7542 7543 assert_eq!( 7544 to_html_with_options( 7545 r###"[foo *bar](baz*) 7546"###, 7547 &danger 7548 )?, 7549 r###"<p><a href="baz*">foo *bar</a></p> 7550"###, 7551 r###"Links (522)"### 7552); 7553 7554 assert_eq!( 7555 to_html_with_options( 7556 r###"*foo [bar* baz] 7557"###, 7558 &danger 7559 )?, 7560 r###"<p><em>foo [bar</em> baz]</p> 7561"###, 7562 r###"Links (523)"### 7563); 7564 7565 assert_eq!( 7566 to_html_with_options( 7567 r###"[foo <bar attr="](baz)"> 7568"###, 7569 &danger 7570 )?, 7571 r###"<p>[foo <bar attr="](baz)"></p> 7572"###, 7573 r###"Links (524)"### 7574); 7575 7576 assert_eq!( 7577 to_html_with_options( 7578 r###"[foo`](/uri)` 7579"###, 7580 &danger 7581 )?, 7582 r###"<p>[foo<code>](/uri)</code></p> 7583"###, 7584 r###"Links (525)"### 7585); 7586 7587 assert_eq!( 7588 to_html_with_options( 7589 r###"[foo<https://example.com/?search=](uri)> 7590"###, 7591 &danger 7592 )?, 7593 r###"<p>[foo<a href="https://example.com/?search=%5D(uri)">https://example.com/?search=](uri)</a></p> 7594"###, 7595 r###"Links (526)"### 7596); 7597 7598 assert_eq!( 7599 to_html_with_options( 7600 r###"[foo][bar] 7601 7602[bar]: /url "title" 7603"###, 7604 &danger 7605 )?, 7606 r###"<p><a href="/url" title="title">foo</a></p> 7607"###, 7608 r###"Links (527)"### 7609); 7610 7611 assert_eq!( 7612 to_html_with_options( 7613 r###"[link [foo [bar]]][ref] 7614 7615[ref]: /uri 7616"###, 7617 &danger 7618 )?, 7619 r###"<p><a href="/uri">link [foo [bar]]</a></p> 7620"###, 7621 r###"Links (528)"### 7622); 7623 7624 assert_eq!( 7625 to_html_with_options( 7626 r###"[link \[bar][ref] 7627 7628[ref]: /uri 7629"###, 7630 &danger 7631 )?, 7632 r###"<p><a href="/uri">link [bar</a></p> 7633"###, 7634 r###"Links (529)"### 7635); 7636 7637 assert_eq!( 7638 to_html_with_options( 7639 r###"[link *foo **bar** `#`*][ref] 7640 7641[ref]: /uri 7642"###, 7643 &danger 7644 )?, 7645 r###"<p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p> 7646"###, 7647 r###"Links (530)"### 7648); 7649 7650 assert_eq!( 7651 to_html_with_options( 7652 r###"[![moon](moon.jpg)][ref] 7653 7654[ref]: /uri 7655"###, 7656 &danger 7657 )?, 7658 r###"<p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p> 7659"###, 7660 r###"Links (531)"### 7661); 7662 7663 assert_eq!( 7664 to_html_with_options( 7665 r###"[foo [bar](/uri)][ref] 7666 7667[ref]: /uri 7668"###, 7669 &danger 7670 )?, 7671 r###"<p>[foo <a href="/uri">bar</a>]<a href="/uri">ref</a></p> 7672"###, 7673 r###"Links (532)"### 7674); 7675 7676 assert_eq!( 7677 to_html_with_options( 7678 r###"[foo *bar [baz][ref]*][ref] 7679 7680[ref]: /uri 7681"###, 7682 &danger 7683 )?, 7684 r###"<p>[foo <em>bar <a href="/uri">baz</a></em>]<a href="/uri">ref</a></p> 7685"###, 7686 r###"Links (533)"### 7687); 7688 7689 assert_eq!( 7690 to_html_with_options( 7691 r###"*[foo*][ref] 7692 7693[ref]: /uri 7694"###, 7695 &danger 7696 )?, 7697 r###"<p>*<a href="/uri">foo*</a></p> 7698"###, 7699 r###"Links (534)"### 7700); 7701 7702 assert_eq!( 7703 to_html_with_options( 7704 r###"[foo *bar][ref]* 7705 7706[ref]: /uri 7707"###, 7708 &danger 7709 )?, 7710 r###"<p><a href="/uri">foo *bar</a>*</p> 7711"###, 7712 r###"Links (535)"### 7713); 7714 7715 assert_eq!( 7716 to_html_with_options( 7717 r###"[foo <bar attr="][ref]"> 7718 7719[ref]: /uri 7720"###, 7721 &danger 7722 )?, 7723 r###"<p>[foo <bar attr="][ref]"></p> 7724"###, 7725 r###"Links (536)"### 7726); 7727 7728 assert_eq!( 7729 to_html_with_options( 7730 r###"[foo`][ref]` 7731 7732[ref]: /uri 7733"###, 7734 &danger 7735 )?, 7736 r###"<p>[foo<code>][ref]</code></p> 7737"###, 7738 r###"Links (537)"### 7739); 7740 7741 assert_eq!( 7742 to_html_with_options( 7743 r###"[foo<https://example.com/?search=][ref]> 7744 7745[ref]: /uri 7746"###, 7747 &danger 7748 )?, 7749 r###"<p>[foo<a href="https://example.com/?search=%5D%5Bref%5D">https://example.com/?search=][ref]</a></p> 7750"###, 7751 r###"Links (538)"### 7752); 7753 7754 assert_eq!( 7755 to_html_with_options( 7756 r###"[foo][BaR] 7757 7758[bar]: /url "title" 7759"###, 7760 &danger 7761 )?, 7762 r###"<p><a href="/url" title="title">foo</a></p> 7763"###, 7764 r###"Links (539)"### 7765); 7766 7767 assert_eq!( 7768 to_html_with_options( 7769 r###"[ẞ] 7770 7771[SS]: /url 7772"###, 7773 &danger 7774 )?, 7775 r###"<p><a href="/url">ẞ</a></p> 7776"###, 7777 r###"Links (540)"### 7778); 7779 7780 assert_eq!( 7781 to_html_with_options( 7782 r###"[Foo 7783 bar]: /url 7784 7785[Baz][Foo bar] 7786"###, 7787 &danger 7788 )?, 7789 r###"<p><a href="/url">Baz</a></p> 7790"###, 7791 r###"Links (541)"### 7792); 7793 7794 assert_eq!( 7795 to_html_with_options( 7796 r###"[foo] [bar] 7797 7798[bar]: /url "title" 7799"###, 7800 &danger 7801 )?, 7802 r###"<p>[foo] <a href="/url" title="title">bar</a></p> 7803"###, 7804 r###"Links (542)"### 7805); 7806 7807 assert_eq!( 7808 to_html_with_options( 7809 r###"[foo] 7810[bar] 7811 7812[bar]: /url "title" 7813"###, 7814 &danger 7815 )?, 7816 r###"<p>[foo] 7817<a href="/url" title="title">bar</a></p> 7818"###, 7819 r###"Links (543)"### 7820); 7821 7822 assert_eq!( 7823 to_html_with_options( 7824 r###"[foo]: /url1 7825 7826[foo]: /url2 7827 7828[bar][foo] 7829"###, 7830 &danger 7831 )?, 7832 r###"<p><a href="/url1">bar</a></p> 7833"###, 7834 r###"Links (544)"### 7835); 7836 7837 assert_eq!( 7838 to_html_with_options( 7839 r###"[bar][foo\!] 7840 7841[foo!]: /url 7842"###, 7843 &danger 7844 )?, 7845 r###"<p>[bar][foo!]</p> 7846"###, 7847 r###"Links (545)"### 7848); 7849 7850 assert_eq!( 7851 to_html_with_options( 7852 r###"[foo][ref[] 7853 7854[ref[]: /uri 7855"###, 7856 &danger 7857 )?, 7858 r###"<p>[foo][ref[]</p> 7859<p>[ref[]: /uri</p> 7860"###, 7861 r###"Links (546)"### 7862); 7863 7864 assert_eq!( 7865 to_html_with_options( 7866 r###"[foo][ref[bar]] 7867 7868[ref[bar]]: /uri 7869"###, 7870 &danger 7871 )?, 7872 r###"<p>[foo][ref[bar]]</p> 7873<p>[ref[bar]]: /uri</p> 7874"###, 7875 r###"Links (547)"### 7876); 7877 7878 assert_eq!( 7879 to_html_with_options( 7880 r###"[[[foo]]] 7881 7882[[[foo]]]: /url 7883"###, 7884 &danger 7885 )?, 7886 r###"<p>[[[foo]]]</p> 7887<p>[[[foo]]]: /url</p> 7888"###, 7889 r###"Links (548)"### 7890); 7891 7892 assert_eq!( 7893 to_html_with_options( 7894 r###"[foo][ref\[] 7895 7896[ref\[]: /uri 7897"###, 7898 &danger 7899 )?, 7900 r###"<p><a href="/uri">foo</a></p> 7901"###, 7902 r###"Links (549)"### 7903); 7904 7905 assert_eq!( 7906 to_html_with_options( 7907 r###"[bar\\]: /uri 7908 7909[bar\\] 7910"###, 7911 &danger 7912 )?, 7913 r###"<p><a href="/uri">bar\</a></p> 7914"###, 7915 r###"Links (550)"### 7916); 7917 7918 assert_eq!( 7919 to_html_with_options( 7920 r###"[] 7921 7922[]: /uri 7923"###, 7924 &danger 7925 )?, 7926 r###"<p>[]</p> 7927<p>[]: /uri</p> 7928"###, 7929 r###"Links (551)"### 7930); 7931 7932 assert_eq!( 7933 to_html_with_options( 7934 r###"[ 7935 ] 7936 7937[ 7938 ]: /uri 7939"###, 7940 &danger 7941 )?, 7942 r###"<p>[ 7943]</p> 7944<p>[ 7945]: /uri</p> 7946"###, 7947 r###"Links (552)"### 7948); 7949 7950 assert_eq!( 7951 to_html_with_options( 7952 r###"[foo][] 7953 7954[foo]: /url "title" 7955"###, 7956 &danger 7957 )?, 7958 r###"<p><a href="/url" title="title">foo</a></p> 7959"###, 7960 r###"Links (553)"### 7961); 7962 7963 assert_eq!( 7964 to_html_with_options( 7965 r###"[*foo* bar][] 7966 7967[*foo* bar]: /url "title" 7968"###, 7969 &danger 7970 )?, 7971 r###"<p><a href="/url" title="title"><em>foo</em> bar</a></p> 7972"###, 7973 r###"Links (554)"### 7974); 7975 7976 assert_eq!( 7977 to_html_with_options( 7978 r###"[Foo][] 7979 7980[foo]: /url "title" 7981"###, 7982 &danger 7983 )?, 7984 r###"<p><a href="/url" title="title">Foo</a></p> 7985"###, 7986 r###"Links (555)"### 7987); 7988 7989 assert_eq!( 7990 to_html_with_options( 7991 r###"[foo] 7992[] 7993 7994[foo]: /url "title" 7995"###, 7996 &danger 7997 )?, 7998 r###"<p><a href="/url" title="title">foo</a> 7999[]</p> 8000"###, 8001 r###"Links (556)"### 8002); 8003 8004 assert_eq!( 8005 to_html_with_options( 8006 r###"[foo] 8007 8008[foo]: /url "title" 8009"###, 8010 &danger 8011 )?, 8012 r###"<p><a href="/url" title="title">foo</a></p> 8013"###, 8014 r###"Links (557)"### 8015); 8016 8017 assert_eq!( 8018 to_html_with_options( 8019 r###"[*foo* bar] 8020 8021[*foo* bar]: /url "title" 8022"###, 8023 &danger 8024 )?, 8025 r###"<p><a href="/url" title="title"><em>foo</em> bar</a></p> 8026"###, 8027 r###"Links (558)"### 8028); 8029 8030 assert_eq!( 8031 to_html_with_options( 8032 r###"[[*foo* bar]] 8033 8034[*foo* bar]: /url "title" 8035"###, 8036 &danger 8037 )?, 8038 r###"<p>[<a href="/url" title="title"><em>foo</em> bar</a>]</p> 8039"###, 8040 r###"Links (559)"### 8041); 8042 8043 assert_eq!( 8044 to_html_with_options( 8045 r###"[[bar [foo] 8046 8047[foo]: /url 8048"###, 8049 &danger 8050 )?, 8051 r###"<p>[[bar <a href="/url">foo</a></p> 8052"###, 8053 r###"Links (560)"### 8054); 8055 8056 assert_eq!( 8057 to_html_with_options( 8058 r###"[Foo] 8059 8060[foo]: /url "title" 8061"###, 8062 &danger 8063 )?, 8064 r###"<p><a href="/url" title="title">Foo</a></p> 8065"###, 8066 r###"Links (561)"### 8067); 8068 8069 assert_eq!( 8070 to_html_with_options( 8071 r###"[foo] bar 8072 8073[foo]: /url 8074"###, 8075 &danger 8076 )?, 8077 r###"<p><a href="/url">foo</a> bar</p> 8078"###, 8079 r###"Links (562)"### 8080); 8081 8082 assert_eq!( 8083 to_html_with_options( 8084 r###"\[foo] 8085 8086[foo]: /url "title" 8087"###, 8088 &danger 8089 )?, 8090 r###"<p>[foo]</p> 8091"###, 8092 r###"Links (563)"### 8093); 8094 8095 assert_eq!( 8096 to_html_with_options( 8097 r###"[foo*]: /url 8098 8099*[foo*] 8100"###, 8101 &danger 8102 )?, 8103 r###"<p>*<a href="/url">foo*</a></p> 8104"###, 8105 r###"Links (564)"### 8106); 8107 8108 assert_eq!( 8109 to_html_with_options( 8110 r###"[foo][bar] 8111 8112[foo]: /url1 8113[bar]: /url2 8114"###, 8115 &danger 8116 )?, 8117 r###"<p><a href="/url2">foo</a></p> 8118"###, 8119 r###"Links (565)"### 8120); 8121 8122 assert_eq!( 8123 to_html_with_options( 8124 r###"[foo][] 8125 8126[foo]: /url1 8127"###, 8128 &danger 8129 )?, 8130 r###"<p><a href="/url1">foo</a></p> 8131"###, 8132 r###"Links (566)"### 8133); 8134 8135 assert_eq!( 8136 to_html_with_options( 8137 r###"[foo]() 8138 8139[foo]: /url1 8140"###, 8141 &danger 8142 )?, 8143 r###"<p><a href="">foo</a></p> 8144"###, 8145 r###"Links (567)"### 8146); 8147 8148 assert_eq!( 8149 to_html_with_options( 8150 r###"[foo](not a link) 8151 8152[foo]: /url1 8153"###, 8154 &danger 8155 )?, 8156 r###"<p><a href="/url1">foo</a>(not a link)</p> 8157"###, 8158 r###"Links (568)"### 8159); 8160 8161 assert_eq!( 8162 to_html_with_options( 8163 r###"[foo][bar][baz] 8164 8165[baz]: /url 8166"###, 8167 &danger 8168 )?, 8169 r###"<p>[foo]<a href="/url">bar</a></p> 8170"###, 8171 r###"Links (569)"### 8172); 8173 8174 assert_eq!( 8175 to_html_with_options( 8176 r###"[foo][bar][baz] 8177 8178[baz]: /url1 8179[bar]: /url2 8180"###, 8181 &danger 8182 )?, 8183 r###"<p><a href="/url2">foo</a><a href="/url1">baz</a></p> 8184"###, 8185 r###"Links (570)"### 8186); 8187 8188 assert_eq!( 8189 to_html_with_options( 8190 r###"[foo][bar][baz] 8191 8192[baz]: /url1 8193[foo]: /url2 8194"###, 8195 &danger 8196 )?, 8197 r###"<p>[foo]<a href="/url1">bar</a></p> 8198"###, 8199 r###"Links (571)"### 8200); 8201 8202 assert_eq!( 8203 to_html_with_options( 8204 r###"![foo](/url "title") 8205"###, 8206 &danger 8207 )?, 8208 r###"<p><img src="/url" alt="foo" title="title" /></p> 8209"###, 8210 r###"Images (572)"### 8211); 8212 8213 assert_eq!( 8214 to_html_with_options( 8215 r###"![foo *bar*] 8216 8217[foo *bar*]: train.jpg "train & tracks" 8218"###, 8219 &danger 8220 )?, 8221 r###"<p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p> 8222"###, 8223 r###"Images (573)"### 8224); 8225 8226 assert_eq!( 8227 to_html_with_options( 8228 r###"![foo ![bar](/url)](/url2) 8229"###, 8230 &danger 8231 )?, 8232 r###"<p><img src="/url2" alt="foo bar" /></p> 8233"###, 8234 r###"Images (574)"### 8235); 8236 8237 assert_eq!( 8238 to_html_with_options( 8239 r###"![foo [bar](/url)](/url2) 8240"###, 8241 &danger 8242 )?, 8243 r###"<p><img src="/url2" alt="foo bar" /></p> 8244"###, 8245 r###"Images (575)"### 8246); 8247 8248 assert_eq!( 8249 to_html_with_options( 8250 r###"![foo *bar*][] 8251 8252[foo *bar*]: train.jpg "train & tracks" 8253"###, 8254 &danger 8255 )?, 8256 r###"<p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p> 8257"###, 8258 r###"Images (576)"### 8259); 8260 8261 assert_eq!( 8262 to_html_with_options( 8263 r###"![foo *bar*][foobar] 8264 8265[FOOBAR]: train.jpg "train & tracks" 8266"###, 8267 &danger 8268 )?, 8269 r###"<p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p> 8270"###, 8271 r###"Images (577)"### 8272); 8273 8274 assert_eq!( 8275 to_html_with_options( 8276 r###"![foo](train.jpg) 8277"###, 8278 &danger 8279 )?, 8280 r###"<p><img src="train.jpg" alt="foo" /></p> 8281"###, 8282 r###"Images (578)"### 8283); 8284 8285 assert_eq!( 8286 to_html_with_options( 8287 r###"My ![foo bar](/path/to/train.jpg "title" ) 8288"###, 8289 &danger 8290 )?, 8291 r###"<p>My <img src="/path/to/train.jpg" alt="foo bar" title="title" /></p> 8292"###, 8293 r###"Images (579)"### 8294); 8295 8296 assert_eq!( 8297 to_html_with_options( 8298 r###"![foo](<url>) 8299"###, 8300 &danger 8301 )?, 8302 r###"<p><img src="url" alt="foo" /></p> 8303"###, 8304 r###"Images (580)"### 8305); 8306 8307 assert_eq!( 8308 to_html_with_options( 8309 r###"![](/url) 8310"###, 8311 &danger 8312 )?, 8313 r###"<p><img src="/url" alt="" /></p> 8314"###, 8315 r###"Images (581)"### 8316); 8317 8318 assert_eq!( 8319 to_html_with_options( 8320 r###"![foo][bar] 8321 8322[bar]: /url 8323"###, 8324 &danger 8325 )?, 8326 r###"<p><img src="/url" alt="foo" /></p> 8327"###, 8328 r###"Images (582)"### 8329); 8330 8331 assert_eq!( 8332 to_html_with_options( 8333 r###"![foo][bar] 8334 8335[BAR]: /url 8336"###, 8337 &danger 8338 )?, 8339 r###"<p><img src="/url" alt="foo" /></p> 8340"###, 8341 r###"Images (583)"### 8342); 8343 8344 assert_eq!( 8345 to_html_with_options( 8346 r###"![foo][] 8347 8348[foo]: /url "title" 8349"###, 8350 &danger 8351 )?, 8352 r###"<p><img src="/url" alt="foo" title="title" /></p> 8353"###, 8354 r###"Images (584)"### 8355); 8356 8357 assert_eq!( 8358 to_html_with_options( 8359 r###"![*foo* bar][] 8360 8361[*foo* bar]: /url "title" 8362"###, 8363 &danger 8364 )?, 8365 r###"<p><img src="/url" alt="foo bar" title="title" /></p> 8366"###, 8367 r###"Images (585)"### 8368); 8369 8370 assert_eq!( 8371 to_html_with_options( 8372 r###"![Foo][] 8373 8374[foo]: /url "title" 8375"###, 8376 &danger 8377 )?, 8378 r###"<p><img src="/url" alt="Foo" title="title" /></p> 8379"###, 8380 r###"Images (586)"### 8381); 8382 8383 assert_eq!( 8384 to_html_with_options( 8385 r###"![foo] 8386[] 8387 8388[foo]: /url "title" 8389"###, 8390 &danger 8391 )?, 8392 r###"<p><img src="/url" alt="foo" title="title" /> 8393[]</p> 8394"###, 8395 r###"Images (587)"### 8396); 8397 8398 assert_eq!( 8399 to_html_with_options( 8400 r###"![foo] 8401 8402[foo]: /url "title" 8403"###, 8404 &danger 8405 )?, 8406 r###"<p><img src="/url" alt="foo" title="title" /></p> 8407"###, 8408 r###"Images (588)"### 8409); 8410 8411 assert_eq!( 8412 to_html_with_options( 8413 r###"![*foo* bar] 8414 8415[*foo* bar]: /url "title" 8416"###, 8417 &danger 8418 )?, 8419 r###"<p><img src="/url" alt="foo bar" title="title" /></p> 8420"###, 8421 r###"Images (589)"### 8422); 8423 8424 assert_eq!( 8425 to_html_with_options( 8426 r###"![[foo]] 8427 8428[[foo]]: /url "title" 8429"###, 8430 &danger 8431 )?, 8432 r###"<p>![[foo]]</p> 8433<p>[[foo]]: /url &quot;title&quot;</p> 8434"###, 8435 r###"Images (590)"### 8436); 8437 8438 assert_eq!( 8439 to_html_with_options( 8440 r###"![Foo] 8441 8442[foo]: /url "title" 8443"###, 8444 &danger 8445 )?, 8446 r###"<p><img src="/url" alt="Foo" title="title" /></p> 8447"###, 8448 r###"Images (591)"### 8449); 8450 8451 assert_eq!( 8452 to_html_with_options( 8453 r###"!\[foo] 8454 8455[foo]: /url "title" 8456"###, 8457 &danger 8458 )?, 8459 r###"<p>![foo]</p> 8460"###, 8461 r###"Images (592)"### 8462); 8463 8464 assert_eq!( 8465 to_html_with_options( 8466 r###"\![foo] 8467 8468[foo]: /url "title" 8469"###, 8470 &danger 8471 )?, 8472 r###"<p>!<a href="/url" title="title">foo</a></p> 8473"###, 8474 r###"Images (593)"### 8475); 8476 8477 assert_eq!( 8478 to_html_with_options( 8479 r###"<http://foo.bar.baz> 8480"###, 8481 &danger 8482 )?, 8483 r###"<p><a href="http://foo.bar.baz">http://foo.bar.baz</a></p> 8484"###, 8485 r###"Autolinks (594)"### 8486); 8487 8488 assert_eq!( 8489 to_html_with_options( 8490 r###"<https://foo.bar.baz/test?q=hello&id=22&boolean> 8491"###, 8492 &danger 8493 )?, 8494 r###"<p><a href="https://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean">https://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean</a></p> 8495"###, 8496 r###"Autolinks (595)"### 8497); 8498 8499 assert_eq!( 8500 to_html_with_options( 8501 r###"<irc://foo.bar:2233/baz> 8502"###, 8503 &danger 8504 )?, 8505 r###"<p><a href="irc://foo.bar:2233/baz">irc://foo.bar:2233/baz</a></p> 8506"###, 8507 r###"Autolinks (596)"### 8508); 8509 8510 assert_eq!( 8511 to_html_with_options( 8512 r###"<MAILTO:FOO@BAR.BAZ> 8513"###, 8514 &danger 8515 )?, 8516 r###"<p><a href="MAILTO:FOO@BAR.BAZ">MAILTO:FOO@BAR.BAZ</a></p> 8517"###, 8518 r###"Autolinks (597)"### 8519); 8520 8521 assert_eq!( 8522 to_html_with_options( 8523 r###"<a+b+c:d> 8524"###, 8525 &danger 8526 )?, 8527 r###"<p><a href="a+b+c:d">a+b+c:d</a></p> 8528"###, 8529 r###"Autolinks (598)"### 8530); 8531 8532 assert_eq!( 8533 to_html_with_options( 8534 r###"<made-up-scheme://foo,bar> 8535"###, 8536 &danger 8537 )?, 8538 r###"<p><a href="made-up-scheme://foo,bar">made-up-scheme://foo,bar</a></p> 8539"###, 8540 r###"Autolinks (599)"### 8541); 8542 8543 assert_eq!( 8544 to_html_with_options( 8545 r###"<https://../> 8546"###, 8547 &danger 8548 )?, 8549 r###"<p><a href="https://../">https://../</a></p> 8550"###, 8551 r###"Autolinks (600)"### 8552); 8553 8554 assert_eq!( 8555 to_html_with_options( 8556 r###"<localhost:5001/foo> 8557"###, 8558 &danger 8559 )?, 8560 r###"<p><a href="localhost:5001/foo">localhost:5001/foo</a></p> 8561"###, 8562 r###"Autolinks (601)"### 8563); 8564 8565 assert_eq!( 8566 to_html_with_options( 8567 r###"<https://foo.bar/baz bim> 8568"###, 8569 &danger 8570 )?, 8571 r###"<p>&lt;https://foo.bar/baz bim&gt;</p> 8572"###, 8573 r###"Autolinks (602)"### 8574); 8575 8576 assert_eq!( 8577 to_html_with_options( 8578 r###"<https://example.com/\[\> 8579"###, 8580 &danger 8581 )?, 8582 r###"<p><a href="https://example.com/%5C%5B%5C">https://example.com/\[\</a></p> 8583"###, 8584 r###"Autolinks (603)"### 8585); 8586 8587 assert_eq!( 8588 to_html_with_options( 8589 r###"<foo@bar.example.com> 8590"###, 8591 &danger 8592 )?, 8593 r###"<p><a href="mailto:foo@bar.example.com">foo@bar.example.com</a></p> 8594"###, 8595 r###"Autolinks (604)"### 8596); 8597 8598 assert_eq!( 8599 to_html_with_options( 8600 r###"<foo+special@Bar.baz-bar0.com> 8601"###, 8602 &danger 8603 )?, 8604 r###"<p><a href="mailto:foo+special@Bar.baz-bar0.com">foo+special@Bar.baz-bar0.com</a></p> 8605"###, 8606 r###"Autolinks (605)"### 8607); 8608 8609 assert_eq!( 8610 to_html_with_options( 8611 r###"<foo\+@bar.example.com> 8612"###, 8613 &danger 8614 )?, 8615 r###"<p>&lt;foo+@bar.example.com&gt;</p> 8616"###, 8617 r###"Autolinks (606)"### 8618); 8619 8620 assert_eq!( 8621 to_html_with_options( 8622 r###"<> 8623"###, 8624 &danger 8625 )?, 8626 r###"<p>&lt;&gt;</p> 8627"###, 8628 r###"Autolinks (607)"### 8629); 8630 8631 assert_eq!( 8632 to_html_with_options( 8633 r###"< https://foo.bar > 8634"###, 8635 &danger 8636 )?, 8637 r###"<p>&lt; https://foo.bar &gt;</p> 8638"###, 8639 r###"Autolinks (608)"### 8640); 8641 8642 assert_eq!( 8643 to_html_with_options( 8644 r###"<m:abc> 8645"###, 8646 &danger 8647 )?, 8648 r###"<p>&lt;m:abc&gt;</p> 8649"###, 8650 r###"Autolinks (609)"### 8651); 8652 8653 assert_eq!( 8654 to_html_with_options( 8655 r###"<foo.bar.baz> 8656"###, 8657 &danger 8658 )?, 8659 r###"<p>&lt;foo.bar.baz&gt;</p> 8660"###, 8661 r###"Autolinks (610)"### 8662); 8663 8664 assert_eq!( 8665 to_html_with_options( 8666 r###"https://example.com 8667"###, 8668 &danger 8669 )?, 8670 r###"<p>https://example.com</p> 8671"###, 8672 r###"Autolinks (611)"### 8673); 8674 8675 assert_eq!( 8676 to_html_with_options( 8677 r###"foo@bar.example.com 8678"###, 8679 &danger 8680 )?, 8681 r###"<p>foo@bar.example.com</p> 8682"###, 8683 r###"Autolinks (612)"### 8684); 8685 8686 assert_eq!( 8687 to_html_with_options( 8688 r###"<a><bab><c2c> 8689"###, 8690 &danger 8691 )?, 8692 r###"<p><a><bab><c2c></p> 8693"###, 8694 r###"Raw HTML (613)"### 8695); 8696 8697 assert_eq!( 8698 to_html_with_options( 8699 r###"<a/><b2/> 8700"###, 8701 &danger 8702 )?, 8703 r###"<p><a/><b2/></p> 8704"###, 8705 r###"Raw HTML (614)"### 8706); 8707 8708 assert_eq!( 8709 to_html_with_options( 8710 r###"<a /><b2 8711data="foo" > 8712"###, 8713 &danger 8714 )?, 8715 r###"<p><a /><b2 8716data="foo" ></p> 8717"###, 8718 r###"Raw HTML (615)"### 8719); 8720 8721 assert_eq!( 8722 to_html_with_options( 8723 r###"<a foo="bar" bam = 'baz <em>"</em>' 8724_boolean zoop:33=zoop:33 /> 8725"###, 8726 &danger 8727 )?, 8728 r###"<p><a foo="bar" bam = 'baz <em>"</em>' 8729_boolean zoop:33=zoop:33 /></p> 8730"###, 8731 r###"Raw HTML (616)"### 8732); 8733 8734 assert_eq!( 8735 to_html_with_options( 8736 r###"Foo <responsive-image src="foo.jpg" /> 8737"###, 8738 &danger 8739 )?, 8740 r###"<p>Foo <responsive-image src="foo.jpg" /></p> 8741"###, 8742 r###"Raw HTML (617)"### 8743); 8744 8745 assert_eq!( 8746 to_html_with_options( 8747 r###"<33> <__> 8748"###, 8749 &danger 8750 )?, 8751 r###"<p>&lt;33&gt; &lt;__&gt;</p> 8752"###, 8753 r###"Raw HTML (618)"### 8754); 8755 8756 assert_eq!( 8757 to_html_with_options( 8758 r###"<a h*#ref="hi"> 8759"###, 8760 &danger 8761 )?, 8762 r###"<p>&lt;a h*#ref=&quot;hi&quot;&gt;</p> 8763"###, 8764 r###"Raw HTML (619)"### 8765); 8766 8767 assert_eq!( 8768 to_html_with_options( 8769 r###"<a href="hi'> <a href=hi'> 8770"###, 8771 &danger 8772 )?, 8773 r###"<p>&lt;a href=&quot;hi'&gt; &lt;a href=hi'&gt;</p> 8774"###, 8775 r###"Raw HTML (620)"### 8776); 8777 8778 assert_eq!( 8779 to_html_with_options( 8780 r###"< a>< 8781foo><bar/ > 8782<foo bar=baz 8783bim!bop /> 8784"###, 8785 &danger 8786 )?, 8787 r###"<p>&lt; a&gt;&lt; 8788foo&gt;&lt;bar/ &gt; 8789&lt;foo bar=baz 8790bim!bop /&gt;</p> 8791"###, 8792 r###"Raw HTML (621)"### 8793); 8794 8795 assert_eq!( 8796 to_html_with_options( 8797 r###"<a href='bar'title=title> 8798"###, 8799 &danger 8800 )?, 8801 r###"<p>&lt;a href='bar'title=title&gt;</p> 8802"###, 8803 r###"Raw HTML (622)"### 8804); 8805 8806 assert_eq!( 8807 to_html_with_options( 8808 r###"</a></foo > 8809"###, 8810 &danger 8811 )?, 8812 r###"<p></a></foo ></p> 8813"###, 8814 r###"Raw HTML (623)"### 8815); 8816 8817 assert_eq!( 8818 to_html_with_options( 8819 r###"</a href="foo"> 8820"###, 8821 &danger 8822 )?, 8823 r###"<p>&lt;/a href=&quot;foo&quot;&gt;</p> 8824"###, 8825 r###"Raw HTML (624)"### 8826); 8827 8828 assert_eq!( 8829 to_html_with_options( 8830 r###"foo <!-- this is a -- 8831comment - with hyphens --> 8832"###, 8833 &danger 8834 )?, 8835 r###"<p>foo <!-- this is a -- 8836comment - with hyphens --></p> 8837"###, 8838 r###"Raw HTML (625)"### 8839); 8840 8841 assert_eq!( 8842 to_html_with_options( 8843 r###"foo <!--> foo --> 8844 8845foo <!---> foo --> 8846"###, 8847 &danger 8848 )?, 8849 r###"<p>foo <!--> foo --&gt;</p> 8850<p>foo <!---> foo --&gt;</p> 8851"###, 8852 r###"Raw HTML (626)"### 8853); 8854 8855 assert_eq!( 8856 to_html_with_options( 8857 r###"foo <?php echo $a; ?> 8858"###, 8859 &danger 8860 )?, 8861 r###"<p>foo <?php echo $a; ?></p> 8862"###, 8863 r###"Raw HTML (627)"### 8864); 8865 8866 assert_eq!( 8867 to_html_with_options( 8868 r###"foo <!ELEMENT br EMPTY> 8869"###, 8870 &danger 8871 )?, 8872 r###"<p>foo <!ELEMENT br EMPTY></p> 8873"###, 8874 r###"Raw HTML (628)"### 8875); 8876 8877 assert_eq!( 8878 to_html_with_options( 8879 r###"foo <![CDATA[>&<]]> 8880"###, 8881 &danger 8882 )?, 8883 r###"<p>foo <![CDATA[>&<]]></p> 8884"###, 8885 r###"Raw HTML (629)"### 8886); 8887 8888 assert_eq!( 8889 to_html_with_options( 8890 r###"foo <a href="&ouml;"> 8891"###, 8892 &danger 8893 )?, 8894 r###"<p>foo <a href="&ouml;"></p> 8895"###, 8896 r###"Raw HTML (630)"### 8897); 8898 8899 assert_eq!( 8900 to_html_with_options( 8901 r###"foo <a href="\*"> 8902"###, 8903 &danger 8904 )?, 8905 r###"<p>foo <a href="\*"></p> 8906"###, 8907 r###"Raw HTML (631)"### 8908); 8909 8910 assert_eq!( 8911 to_html_with_options( 8912 r###"<a href="\""> 8913"###, 8914 &danger 8915 )?, 8916 r###"<p>&lt;a href=&quot;&quot;&quot;&gt;</p> 8917"###, 8918 r###"Raw HTML (632)"### 8919); 8920 8921 assert_eq!( 8922 to_html_with_options( 8923 r###"foo 8924baz 8925"###, 8926 &danger 8927 )?, 8928 r###"<p>foo<br /> 8929baz</p> 8930"###, 8931 r###"Hard line breaks (633)"### 8932); 8933 8934 assert_eq!( 8935 to_html_with_options( 8936 r###"foo\ 8937baz 8938"###, 8939 &danger 8940 )?, 8941 r###"<p>foo<br /> 8942baz</p> 8943"###, 8944 r###"Hard line breaks (634)"### 8945); 8946 8947 assert_eq!( 8948 to_html_with_options( 8949 r###"foo 8950baz 8951"###, 8952 &danger 8953 )?, 8954 r###"<p>foo<br /> 8955baz</p> 8956"###, 8957 r###"Hard line breaks (635)"### 8958); 8959 8960 assert_eq!( 8961 to_html_with_options( 8962 r###"foo 8963 bar 8964"###, 8965 &danger 8966 )?, 8967 r###"<p>foo<br /> 8968bar</p> 8969"###, 8970 r###"Hard line breaks (636)"### 8971); 8972 8973 assert_eq!( 8974 to_html_with_options( 8975 r###"foo\ 8976 bar 8977"###, 8978 &danger 8979 )?, 8980 r###"<p>foo<br /> 8981bar</p> 8982"###, 8983 r###"Hard line breaks (637)"### 8984); 8985 8986 assert_eq!( 8987 to_html_with_options( 8988 r###"*foo 8989bar* 8990"###, 8991 &danger 8992 )?, 8993 r###"<p><em>foo<br /> 8994bar</em></p> 8995"###, 8996 r###"Hard line breaks (638)"### 8997); 8998 8999 assert_eq!( 9000 to_html_with_options( 9001 r###"*foo\ 9002bar* 9003"###, 9004 &danger 9005 )?, 9006 r###"<p><em>foo<br /> 9007bar</em></p> 9008"###, 9009 r###"Hard line breaks (639)"### 9010); 9011 9012 assert_eq!( 9013 to_html_with_options( 9014 r###"`code 9015span` 9016"###, 9017 &danger 9018 )?, 9019 r###"<p><code>code span</code></p> 9020"###, 9021 r###"Hard line breaks (640)"### 9022); 9023 9024 assert_eq!( 9025 to_html_with_options( 9026 r###"`code\ 9027span` 9028"###, 9029 &danger 9030 )?, 9031 r###"<p><code>code\ span</code></p> 9032"###, 9033 r###"Hard line breaks (641)"### 9034); 9035 9036 assert_eq!( 9037 to_html_with_options( 9038 r###"<a href="foo 9039bar"> 9040"###, 9041 &danger 9042 )?, 9043 r###"<p><a href="foo 9044bar"></p> 9045"###, 9046 r###"Hard line breaks (642)"### 9047); 9048 9049 assert_eq!( 9050 to_html_with_options( 9051 r###"<a href="foo\ 9052bar"> 9053"###, 9054 &danger 9055 )?, 9056 r###"<p><a href="foo\ 9057bar"></p> 9058"###, 9059 r###"Hard line breaks (643)"### 9060); 9061 9062 assert_eq!( 9063 to_html_with_options( 9064 r###"foo\ 9065"###, 9066 &danger 9067 )?, 9068 r###"<p>foo\</p> 9069"###, 9070 r###"Hard line breaks (644)"### 9071); 9072 9073 assert_eq!( 9074 to_html_with_options( 9075 r###"foo 9076"###, 9077 &danger 9078 )?, 9079 r###"<p>foo</p> 9080"###, 9081 r###"Hard line breaks (645)"### 9082); 9083 9084 assert_eq!( 9085 to_html_with_options( 9086 r###"### foo\ 9087"###, 9088 &danger 9089 )?, 9090 r###"<h3>foo\</h3> 9091"###, 9092 r###"Hard line breaks (646)"### 9093); 9094 9095 assert_eq!( 9096 to_html_with_options( 9097 r###"### foo 9098"###, 9099 &danger 9100 )?, 9101 r###"<h3>foo</h3> 9102"###, 9103 r###"Hard line breaks (647)"### 9104); 9105 9106 assert_eq!( 9107 to_html_with_options( 9108 r###"foo 9109baz 9110"###, 9111 &danger 9112 )?, 9113 r###"<p>foo 9114baz</p> 9115"###, 9116 r###"Soft line breaks (648)"### 9117); 9118 9119 assert_eq!( 9120 to_html_with_options( 9121 r###"foo 9122 baz 9123"###, 9124 &danger 9125 )?, 9126 r###"<p>foo 9127baz</p> 9128"###, 9129 r###"Soft line breaks (649)"### 9130); 9131 9132 assert_eq!( 9133 to_html_with_options( 9134 r###"hello $.;'there 9135"###, 9136 &danger 9137 )?, 9138 r###"<p>hello $.;'there</p> 9139"###, 9140 r###"Textual content (650)"### 9141); 9142 9143 assert_eq!( 9144 to_html_with_options( 9145 r###"Foo χρῆν 9146"###, 9147 &danger 9148 )?, 9149 r###"<p>Foo χρῆν</p> 9150"###, 9151 r###"Textual content (651)"### 9152); 9153 9154 assert_eq!( 9155 to_html_with_options( 9156 r###"Multiple spaces 9157"###, 9158 &danger 9159 )?, 9160 r###"<p>Multiple spaces</p> 9161"###, 9162 r###"Textual content (652)"### 9163); 9164 9165 Ok(()) 9166}