| 1 |
<!DOCTYPE html> |
| 2 |
<html lang="en"> |
| 3 |
<head> |
| 4 |
<meta charset="utf-8"> |
| 5 |
<title>turndown test runner</title> |
| 6 |
<link rel="stylesheet" href="../node_modules/turndown-attendant/dist/styles.css"> |
| 7 |
</head> |
| 8 |
<body> |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
<div class="case" data-name="p"> |
| 13 |
<div class="input"><p>Lorem ipsum</p></div> |
| 14 |
<pre class="expected">Lorem ipsum</pre> |
| 15 |
</div> |
| 16 |
|
| 17 |
<div class="case" data-name="multiple ps"> |
| 18 |
<div class="input"> |
| 19 |
<p>Lorem</p> |
| 20 |
<p>ipsum</p> |
| 21 |
<p>sit</p> |
| 22 |
</div> |
| 23 |
<pre class="expected">Lorem |
| 24 |
|
| 25 |
ipsum |
| 26 |
|
| 27 |
sit</pre> |
| 28 |
</div> |
| 29 |
|
| 30 |
<div class="case" data-name="em"> |
| 31 |
<div class="input"><em>em element</em></div> |
| 32 |
<pre class="expected">_em element_</pre> |
| 33 |
</div> |
| 34 |
|
| 35 |
<div class="case" data-name="i"> |
| 36 |
<div class="input"><i>i element</i></div> |
| 37 |
<pre class="expected">_i element_</pre> |
| 38 |
</div> |
| 39 |
|
| 40 |
<div class="case" data-name="strong"> |
| 41 |
<div class="input"><strong>strong element</strong></div> |
| 42 |
<pre class="expected">**strong element**</pre> |
| 43 |
</div> |
| 44 |
|
| 45 |
<div class="case" data-name="b"> |
| 46 |
<div class="input"><b>b element</b></div> |
| 47 |
<pre class="expected">**b element**</pre> |
| 48 |
</div> |
| 49 |
|
| 50 |
<div class="case" data-name="code"> |
| 51 |
<div class="input"><code>code element</code></div> |
| 52 |
<pre class="expected">`code element`</pre> |
| 53 |
</div> |
| 54 |
|
| 55 |
<div class="case" data-name="code containing a backtick"> |
| 56 |
<div class="input"><code>There is a literal backtick (`) here</code></div> |
| 57 |
<pre class="expected">``There is a literal backtick (`) here``</pre> |
| 58 |
</div> |
| 59 |
|
| 60 |
<div class="case" data-name="code containing three or more backticks"> |
| 61 |
<div class="input"><code>here are three ``` here are four ```` that's it</code></div> |
| 62 |
<pre class="expected">`here are three ``` here are four ```` that's it`</pre> |
| 63 |
</div> |
| 64 |
|
| 65 |
<div class="case" data-name="code containing one or more backticks"> |
| 66 |
<div class="input"><code>here are three ``` here are four ```` here is one ` that's it</code></div> |
| 67 |
<pre class="expected">``here are three ``` here are four ```` here is one ` that's it``</pre> |
| 68 |
</div> |
| 69 |
|
| 70 |
<div class="case" data-name="code starting with a backtick"> |
| 71 |
<div class="input"><code>`starting with a backtick</code></div> |
| 72 |
<pre class="expected">`` `starting with a backtick ``</pre> |
| 73 |
</div> |
| 74 |
|
| 75 |
<div class="case" data-name="code containing markdown syntax"> |
| 76 |
<div class="input"><code>_emphasis_</code></div> |
| 77 |
<pre class="expected">`_emphasis_`</pre> |
| 78 |
</div> |
| 79 |
|
| 80 |
<div class="case" data-name="code containing markdown syntax in a span"> |
| 81 |
<div class="input"><code><span>_emphasis_</span></code></div> |
| 82 |
<pre class="expected">`_emphasis_`</pre> |
| 83 |
</div> |
| 84 |
|
| 85 |
<div class="case" data-name="h1"> |
| 86 |
<div class="input"><h1>Level One Heading</h1></div> |
| 87 |
<pre class="expected">Level One Heading |
| 88 |
=================</pre> |
| 89 |
</div> |
| 90 |
|
| 91 |
<div class="case" data-name="escape = when used as heading"> |
| 92 |
<div class="input">===</div> |
| 93 |
<pre class="expected">\===</pre> |
| 94 |
</div> |
| 95 |
|
| 96 |
<div class="case" data-name="not escaping = outside of a heading"> |
| 97 |
<div class="input">A sentence containing =</div> |
| 98 |
<pre class="expected">A sentence containing =</pre> |
| 99 |
</div> |
| 100 |
|
| 101 |
<div class="case" data-name="h1 as atx" data-options='{"headingStyle":"atx"}'> |
| 102 |
<div class="input"><h1>Level One Heading with ATX</h1></div> |
| 103 |
<pre class="expected"># Level One Heading with ATX</pre> |
| 104 |
</div> |
| 105 |
|
| 106 |
<div class="case" data-name="h2"> |
| 107 |
<div class="input"><h2>Level Two Heading</h2></div> |
| 108 |
<pre class="expected">Level Two Heading |
| 109 |
-----------------</pre> |
| 110 |
</div> |
| 111 |
|
| 112 |
<div class="case" data-name="h2 as atx" data-options='{"headingStyle":"atx"}'> |
| 113 |
<div class="input"><h2>Level Two Heading with ATX</h2></div> |
| 114 |
<pre class="expected">## Level Two Heading with ATX</pre> |
| 115 |
</div> |
| 116 |
|
| 117 |
<div class="case" data-name="h3"> |
| 118 |
<div class="input"><h3>Level Three Heading</h3></div> |
| 119 |
<pre class="expected">### Level Three Heading</pre> |
| 120 |
</div> |
| 121 |
|
| 122 |
<div class="case" data-name="heading with child"> |
| 123 |
<div class="input"><h4>Level Four Heading with <code>child</code></h4></div> |
| 124 |
<pre class="expected">#### Level Four Heading with `child`</pre> |
| 125 |
</div> |
| 126 |
|
| 127 |
<div class="case" data-name="invalid heading"> |
| 128 |
<div class="input"><h7>Level Seven Heading?</h7></div> |
| 129 |
<pre class="expected">Level Seven Heading?</pre> |
| 130 |
</div> |
| 131 |
|
| 132 |
<div class="case" data-name="hr"> |
| 133 |
<div class="input"><hr></div> |
| 134 |
<pre class="expected">* * *</pre> |
| 135 |
</div> |
| 136 |
|
| 137 |
<div class="case" data-name="hr with closing tag"> |
| 138 |
<div class="input"><hr></hr></div> |
| 139 |
<pre class="expected">* * *</pre> |
| 140 |
</div> |
| 141 |
|
| 142 |
<div class="case" data-name="hr with option" data-options='{"hr": "- - -"}'> |
| 143 |
<div class="input"><hr></div> |
| 144 |
<pre class="expected">- - -</pre> |
| 145 |
</div> |
| 146 |
|
| 147 |
<div class="case" data-name="br"> |
| 148 |
<div class="input">More<br>after the break</div> |
| 149 |
<pre class="expected">More |
| 150 |
after the break</pre> |
| 151 |
</div> |
| 152 |
|
| 153 |
<div class="case" data-name="br with visible line-ending" data-options='{"br": "\\"}'> |
| 154 |
<div class="input">More<br>after the break</div> |
| 155 |
<pre class="expected">More\ |
| 156 |
after the break</pre> |
| 157 |
</div> |
| 158 |
|
| 159 |
<div class="case" data-name="img with no alt"> |
| 160 |
<div class="input"><img src="http://example.com/logo.png" /></div> |
| 161 |
<pre class="expected"></pre> |
| 162 |
</div> |
| 163 |
|
| 164 |
<div class="case" data-name="img with relative src"> |
| 165 |
<div class="input"><img src="logo.png"></div> |
| 166 |
<pre class="expected"></pre> |
| 167 |
</div> |
| 168 |
|
| 169 |
<div class="case" data-name="img with alt"> |
| 170 |
<div class="input"><img src="logo.png" alt="img with alt"></div> |
| 171 |
<pre class="expected"></pre> |
| 172 |
</div> |
| 173 |
|
| 174 |
<div class="case" data-name="img with escaped content in alt"> |
| 175 |
<div class="input"><img src="logo.png" alt="_img_ *with* [alt]"></div> |
| 176 |
<pre class="expected">![\_img\_ \*with\* \[alt\]](logo.png)</pre> |
| 177 |
</div> |
| 178 |
|
| 179 |
<div class="case" data-name="img with no src"> |
| 180 |
<div class="input"><img></div> |
| 181 |
<pre class="expected"></pre> |
| 182 |
</div> |
| 183 |
|
| 184 |
<div class="case" data-name="img with parenthesis in src"> |
| 185 |
<div class="input"><img src="logo.png?(query)"></div> |
| 186 |
<pre class="expected">)</pre> |
| 187 |
</div> |
| 188 |
|
| 189 |
<div class="case" data-name="img with a new line in alt"> |
| 190 |
<div class="input"><img src="logo.png" alt="img with |
| 191 |
alt"></div> |
| 192 |
<pre class="expected"></pre> |
| 194 |
</div> |
| 195 |
|
| 196 |
<div class="case" data-name="img with more than one new line in alt"> |
| 197 |
<div class="input"><img src="logo.png" alt="img with |
| 198 |
|
| 199 |
alt"></div> |
| 200 |
<pre class="expected"></pre> |
| 202 |
</div> |
| 203 |
|
| 204 |
<div class="case" data-name="img with new lines in title"> |
| 205 |
<div class="input"><img src="logo.png" title="the |
| 206 |
|
| 207 |
title"></div> |
| 208 |
<pre class="expected"></pre> |
| 210 |
</div> |
| 211 |
|
| 212 |
<div class="case" data-name="img with quotes in title"> |
| 213 |
<div class="input"><img src="logo.png" title=""hello""></div> |
| 214 |
<pre class="expected"></pre> |
| 215 |
</div> |
| 216 |
|
| 217 |
<div class="case" data-name="img with space in URL"> |
| 218 |
<div class="input"><img src="logo 1.png" alt="An image"></div> |
| 219 |
<pre class="expected"></pre> |
| 220 |
</div> |
| 221 |
|
| 222 |
<div class="case" data-name="a"> |
| 223 |
<div class="input"><a href="http://example.com">An anchor</a></div> |
| 224 |
<pre class="expected">[An anchor](http://example.com)</pre> |
| 225 |
</div> |
| 226 |
|
| 227 |
<div class="case" data-name="a with space in URL"> |
| 228 |
<div class="input"><a href="http://example.com/foo bar">An anchor</a></div> |
| 229 |
<pre class="expected">[An anchor](<http://example.com/foo bar>)</pre> |
| 230 |
</div> |
| 231 |
|
| 232 |
<div class="case" data-name="a with title"> |
| 233 |
<div class="input"><a href="http://example.com" title="Title for link">An anchor</a></div> |
| 234 |
<pre class="expected">[An anchor](http://example.com "Title for link")</pre> |
| 235 |
</div> |
| 236 |
|
| 237 |
<div class="case" data-name="a with multiline title"> |
| 238 |
<div class="input"><a href="http://example.com" title="Title for |
| 239 |
|
| 240 |
link">An anchor</a></div> |
| 241 |
<pre class="expected">[An anchor](http://example.com "Title for |
| 242 |
link")</pre> |
| 243 |
</div> |
| 244 |
|
| 245 |
<div class="case" data-name="a with quotes in title"> |
| 246 |
<div class="input"><a href="http://example.com" title=""hello"">An anchor</a></div> |
| 247 |
<pre class="expected">[An anchor](http://example.com "\"hello\"")</pre> |
| 248 |
</div> |
| 249 |
|
| 250 |
<div class="case" data-name="a with parenthesis in query"> |
| 251 |
<div class="input"><a href="http://example.com?(query)">An anchor</a></div> |
| 252 |
<pre class="expected">[An anchor](http://example.com?\(query\))</pre> |
| 253 |
</div> |
| 254 |
|
| 255 |
<div class="case" data-name="a without a src"> |
| 256 |
<div class="input"><a id="about-anchor">Anchor without a title</a></div> |
| 257 |
<pre class="expected">Anchor without a title</pre> |
| 258 |
</div> |
| 259 |
|
| 260 |
<div class="case" data-name="a with a child"> |
| 261 |
<div class="input"><a href="http://example.com/code">Some <code>code</code></a></div> |
| 262 |
<pre class="expected">[Some `code`](http://example.com/code)</pre> |
| 263 |
</div> |
| 264 |
|
| 265 |
<div class="case" data-name="a with a brackets in text"> |
| 266 |
<div class="input"><a href="http://example.com/code">Some [text]</a></div> |
| 267 |
<pre class="expected">[Some \[text\]](http://example.com/code)</pre> |
| 268 |
</div> |
| 269 |
|
| 270 |
<div class="case" data-name="a reference" data-options='{"linkStyle": "referenced"}'> |
| 271 |
<div class="input"><a href="http://example.com">Reference link</a></div> |
| 272 |
<pre class="expected">[Reference link][1] |
| 273 |
|
| 274 |
[1]: http://example.com</pre> |
| 275 |
</div> |
| 276 |
|
| 277 |
<div class="case" data-name="a reference with space in URL" data-options='{"linkStyle": "referenced"}'> |
| 278 |
<div class="input"><a href="http://example.com/foo bar">Reference link</a></div> |
| 279 |
<pre class="expected">[Reference link][1] |
| 280 |
|
| 281 |
[1]: <http://example.com/foo bar></pre> |
| 282 |
</div> |
| 283 |
|
| 284 |
<div class="case" data-name="a reference with collapsed style" data-options='{"linkStyle": "referenced", "linkReferenceStyle": "collapsed"}'> |
| 285 |
<div class="input"><a href="http://example.com">Reference link with collapsed style</a></div> |
| 286 |
<pre class="expected">[Reference link with collapsed style][] |
| 287 |
|
| 288 |
[Reference link with collapsed style]: http://example.com</pre> |
| 289 |
</div> |
| 290 |
|
| 291 |
<div class="case" data-name="a reference with shortcut style" data-options='{"linkStyle": "referenced", "linkReferenceStyle": "shortcut"}'> |
| 292 |
<div class="input"><a href="http://example.com">Reference link with shortcut style</a></div> |
| 293 |
<pre class="expected">[Reference link with shortcut style] |
| 294 |
|
| 295 |
[Reference link with shortcut style]: http://example.com</pre> |
| 296 |
</div> |
| 297 |
|
| 298 |
<div class="case" data-name="a reference with title" data-options='{"linkStyle": "referenced"}'> |
| 299 |
<div class="input"><a href="http://example.com" title="Hello " World">Reference link</a></div> |
| 300 |
<pre class="expected">[Reference link][1] |
| 301 |
|
| 302 |
[1]: http://example.com "Hello \" World"</pre> |
| 303 |
</div> |
| 304 |
|
| 305 |
<div class="case" data-name="pre/code block"> |
| 306 |
<div class="input"><pre><code>def code_block |
| 307 |
# 42 < 9001 |
| 308 |
"Hello world!" |
| 309 |
end</code></pre></div> |
| 310 |
|
| 311 |
<pre class="expected"> def code_block |
| 312 |
# 42 < 9001 |
| 313 |
"Hello world!" |
| 314 |
end</pre> |
| 315 |
</div> |
| 316 |
|
| 317 |
<div class="case" data-name="multiple pre/code blocks"> |
| 318 |
<div class="input"><pre><code>def first_code_block |
| 319 |
# 42 < 9001 |
| 320 |
"Hello world!" |
| 321 |
end</code></pre> |
| 322 |
|
| 323 |
<p>next:</p> |
| 324 |
|
| 325 |
<pre><code>def second_code_block |
| 326 |
# 42 < 9001 |
| 327 |
"Hello world!" |
| 328 |
end</code></pre></div> |
| 329 |
|
| 330 |
<pre class="expected"> def first_code_block |
| 331 |
# 42 < 9001 |
| 332 |
"Hello world!" |
| 333 |
end |
| 334 |
|
| 335 |
next: |
| 336 |
|
| 337 |
def second_code_block |
| 338 |
# 42 < 9001 |
| 339 |
"Hello world!" |
| 340 |
end</pre> |
| 341 |
</div> |
| 342 |
|
| 343 |
<div class="case" data-name="pre/code block with multiple new lines"> |
| 344 |
<div class="input"><div><pre><code>Multiple new lines |
| 345 |
|
| 346 |
|
| 347 |
should not be |
| 348 |
|
| 349 |
|
| 350 |
removed</code></pre></div></div> |
| 351 |
|
| 352 |
<pre class="expected"> Multiple new lines |
| 353 |
|
| 354 |
|
| 355 |
should not be |
| 356 |
|
| 357 |
|
| 358 |
removed</pre> |
| 359 |
</div> |
| 360 |
|
| 361 |
<div class="case" data-name="fenced pre/code block" data-options='{"codeBlockStyle": "fenced"}'> |
| 362 |
<div class="input"> |
| 363 |
<pre><code>def a_fenced_code block; end</code></pre> |
| 364 |
</div> |
| 365 |
<pre class="expected">``` |
| 366 |
def a_fenced_code block; end |
| 367 |
```</pre> |
| 368 |
</div> |
| 369 |
|
| 370 |
<div class="case" data-name="pre/code block fenced with ~" data-options='{"codeBlockStyle": "fenced", "fence": "~~~"}'> |
| 371 |
<div class="input"> |
| 372 |
<pre><code>def a_fenced_code block; end</code></pre> |
| 373 |
</div> |
| 374 |
<pre class="expected">~~~ |
| 375 |
def a_fenced_code block; end |
| 376 |
~~~</pre> |
| 377 |
</div> |
| 378 |
|
| 379 |
<div class="case" data-name="escaping ~~~"> |
| 380 |
<div class="input"> |
| 381 |
<pre>~~~ foo</pre> |
| 382 |
</div> |
| 383 |
<pre class="expected">\~~~ foo</pre> |
| 384 |
</div> |
| 385 |
|
| 386 |
<div class="case" data-name="not escaping ~~~"> |
| 387 |
<div class="input">A sentence containing ~~~</div> |
| 388 |
<pre class="expected">A sentence containing ~~~</pre> |
| 389 |
</div> |
| 390 |
|
| 391 |
<div class="case" data-name="fenced pre/code block with language" data-options='{"codeBlockStyle": "fenced"}'> |
| 392 |
<div class="input"> |
| 393 |
<pre><code class="language-ruby">def a_fenced_code block; end</code></pre> |
| 394 |
</div> |
| 395 |
<pre class="expected">```ruby |
| 396 |
def a_fenced_code block; end |
| 397 |
```</pre> |
| 398 |
</div> |
| 399 |
|
| 400 |
<div class="case" data-name="empty pre does not throw error"> |
| 401 |
<div class="input"> |
| 402 |
<pre></pre> |
| 403 |
</div> |
| 404 |
<pre class="expected"></pre> |
| 405 |
</div> |
| 406 |
|
| 407 |
<div class="case" data-name="ol"> |
| 408 |
<div class="input"> |
| 409 |
<ol> |
| 410 |
<li>Ordered list item 1</li> |
| 411 |
<li>Ordered list item 2</li> |
| 412 |
<li>Ordered list item 3</li> |
| 413 |
</ol> |
| 414 |
</div> |
| 415 |
<pre class="expected">1. Ordered list item 1 |
| 416 |
2. Ordered list item 2 |
| 417 |
3. Ordered list item 3</pre> |
| 418 |
</div> |
| 419 |
|
| 420 |
<div class="case" data-name="ol with start"> |
| 421 |
<div class="input"> |
| 422 |
<ol start="42"> |
| 423 |
<li>Ordered list item 42</li> |
| 424 |
<li>Ordered list item 43</li> |
| 425 |
<li>Ordered list item 44</li> |
| 426 |
</ol> |
| 427 |
</div> |
| 428 |
<pre class="expected">42. Ordered list item 42 |
| 429 |
43. Ordered list item 43 |
| 430 |
44. Ordered list item 44</pre> |
| 431 |
</div> |
| 432 |
|
| 433 |
<div class="case" data-name="ol with content"> |
| 434 |
<div class="input"> |
| 435 |
<ol start="42"> |
| 436 |
<li> |
| 437 |
<p>Ordered list item 42</p> |
| 438 |
<p>Ordered list's additional content</p> |
| 439 |
</li> |
| 440 |
</ol> |
| 441 |
</div> |
| 442 |
<pre class="expected">42. Ordered list item 42 |
| 443 |
|
| 444 |
Ordered list's additional content</pre> |
| 445 |
</div> |
| 446 |
|
| 447 |
<div class="case" data-name="list spacing"> |
| 448 |
<div class="input"> |
| 449 |
<p>A paragraph.</p> |
| 450 |
<ol> |
| 451 |
<li>Ordered list item 1</li> |
| 452 |
<li>Ordered list item 2</li> |
| 453 |
<li>Ordered list item 3</li> |
| 454 |
</ol> |
| 455 |
<p>Another paragraph.</p> |
| 456 |
<ul> |
| 457 |
<li>Unordered list item 1</li> |
| 458 |
<li>Unordered list item 2</li> |
| 459 |
<li>Unordered list item 3</li> |
| 460 |
</ul> |
| 461 |
</div> |
| 462 |
<pre class="expected">A paragraph. |
| 463 |
|
| 464 |
1. Ordered list item 1 |
| 465 |
2. Ordered list item 2 |
| 466 |
3. Ordered list item 3 |
| 467 |
|
| 468 |
Another paragraph. |
| 469 |
|
| 470 |
* Unordered list item 1 |
| 471 |
* Unordered list item 2 |
| 472 |
* Unordered list item 3</pre> |
| 473 |
</div> |
| 474 |
|
| 475 |
<div class="case" data-name="ul"> |
| 476 |
<div class="input"> |
| 477 |
<ul> |
| 478 |
<li>Unordered list item 1</li> |
| 479 |
<li>Unordered list item 2</li> |
| 480 |
<li>Unordered list item 3</li> |
| 481 |
</ul> |
| 482 |
</div> |
| 483 |
<pre class="expected">* Unordered list item 1 |
| 484 |
* Unordered list item 2 |
| 485 |
* Unordered list item 3</pre> |
| 486 |
</div> |
| 487 |
|
| 488 |
<div class="case" data-name="ul with custom bullet" data-options='{"bulletListMarker": "-"}'> |
| 489 |
<div class="input"> |
| 490 |
<ul> |
| 491 |
<li>Unordered list item 1</li> |
| 492 |
<li>Unordered list item 2</li> |
| 493 |
<li>Unordered list item 3</li> |
| 494 |
</ul> |
| 495 |
</div> |
| 496 |
<pre class="expected">- Unordered list item 1 |
| 497 |
- Unordered list item 2 |
| 498 |
- Unordered list item 3</pre> |
| 499 |
</div> |
| 500 |
|
| 501 |
<div class="case" data-name="ul with paragraph"> |
| 502 |
<div class="input"> |
| 503 |
<ul> |
| 504 |
<li><p>List item with paragraph</p></li> |
| 505 |
<li>List item without paragraph</li> |
| 506 |
</ul> |
| 507 |
</div> |
| 508 |
<pre class="expected">* List item with paragraph |
| 509 |
|
| 510 |
* List item without paragraph</pre> |
| 511 |
</div> |
| 512 |
|
| 513 |
<div class="case" data-name="ol with paragraphs"> |
| 514 |
<div class="input"> |
| 515 |
<ol> |
| 516 |
<li> |
| 517 |
<p>This is a paragraph in a list item.</p> |
| 518 |
<p>This is a paragraph in the same list item as above.</p> |
| 519 |
</li> |
| 520 |
<li> |
| 521 |
<p>A paragraph in a second list item.</p> |
| 522 |
</li> |
| 523 |
</ol> |
| 524 |
</div> |
| 525 |
<pre class="expected">1. This is a paragraph in a list item. |
| 526 |
|
| 527 |
This is a paragraph in the same list item as above. |
| 528 |
|
| 529 |
2. A paragraph in a second list item.</pre> |
| 530 |
</div> |
| 531 |
|
| 532 |
<div class="case" data-name="nested uls"> |
| 533 |
<div class="input"> |
| 534 |
<ul> |
| 535 |
<li>This is a list item at root level</li> |
| 536 |
<li>This is another item at root level</li> |
| 537 |
<li> |
| 538 |
<ul> |
| 539 |
<li>This is a nested list item</li> |
| 540 |
<li>This is another nested list item</li> |
| 541 |
<li> |
| 542 |
<ul> |
| 543 |
<li>This is a deeply nested list item</li> |
| 544 |
<li>This is another deeply nested list item</li> |
| 545 |
<li>This is a third deeply nested list item</li> |
| 546 |
</ul> |
| 547 |
</li> |
| 548 |
</ul> |
| 549 |
</li> |
| 550 |
<li>This is a third item at root level</li> |
| 551 |
</ul> |
| 552 |
</div> |
| 553 |
<pre class="expected">* This is a list item at root level |
| 554 |
* This is another item at root level |
| 555 |
* * This is a nested list item |
| 556 |
* This is another nested list item |
| 557 |
* * This is a deeply nested list item |
| 558 |
* This is another deeply nested list item |
| 559 |
* This is a third deeply nested list item |
| 560 |
* This is a third item at root level</pre> |
| 561 |
</div> |
| 562 |
|
| 563 |
<div class="case" data-name="nested ols and uls"> |
| 564 |
<div class="input"> |
| 565 |
<ul> |
| 566 |
<li>This is a list item at root level</li> |
| 567 |
<li>This is another item at root level</li> |
| 568 |
<li> |
| 569 |
<ol> |
| 570 |
<li>This is a nested list item</li> |
| 571 |
<li>This is another nested list item</li> |
| 572 |
<li> |
| 573 |
<ul> |
| 574 |
<li>This is a deeply nested list item</li> |
| 575 |
<li>This is another deeply nested list item</li> |
| 576 |
<li>This is a third deeply nested list item</li> |
| 577 |
</ul> |
| 578 |
</li> |
| 579 |
</ol> |
| 580 |
</li> |
| 581 |
<li>This is a third item at root level</li> |
| 582 |
</ul> |
| 583 |
</div> |
| 584 |
<pre class="expected">* This is a list item at root level |
| 585 |
* This is another item at root level |
| 586 |
* 1. This is a nested list item |
| 587 |
2. This is another nested list item |
| 588 |
3. * This is a deeply nested list item |
| 589 |
* This is another deeply nested list item |
| 590 |
* This is a third deeply nested list item |
| 591 |
* This is a third item at root level</pre> |
| 592 |
</div> |
| 593 |
|
| 594 |
<div class="case" data-name="ul with blockquote"> |
| 595 |
<div class="input"> |
| 596 |
<ul> |
| 597 |
<li> |
| 598 |
<p>A list item with a blockquote:</p> |
| 599 |
<blockquote> |
| 600 |
<p>This is a blockquote inside a list item.</p> |
| 601 |
</blockquote> |
| 602 |
</li> |
| 603 |
</ul> |
| 604 |
</div> |
| 605 |
<pre class="expected">* A list item with a blockquote: |
| 606 |
|
| 607 |
> This is a blockquote inside a list item.</pre> |
| 608 |
</div> |
| 609 |
|
| 610 |
<div class="case" data-name="blockquote"> |
| 611 |
<div class="input"> |
| 612 |
<blockquote> |
| 613 |
<p>This is a paragraph within a blockquote.</p> |
| 614 |
<p>This is another paragraph within a blockquote.</p> |
| 615 |
</blockquote> |
| 616 |
</div> |
| 617 |
<pre class="expected">> This is a paragraph within a blockquote. |
| 618 |
> |
| 619 |
> This is another paragraph within a blockquote.</pre> |
| 620 |
</div> |
| 621 |
|
| 622 |
<div class="case" data-name="nested blockquotes"> |
| 623 |
<div class="input"> |
| 624 |
<blockquote> |
| 625 |
<p>This is the first level of quoting.</p> |
| 626 |
<blockquote> |
| 627 |
<p>This is a paragraph in a nested blockquote.</p> |
| 628 |
</blockquote> |
| 629 |
<p>Back to the first level.</p> |
| 630 |
</blockquote> |
| 631 |
</div> |
| 632 |
<pre class="expected">> This is the first level of quoting. |
| 633 |
> |
| 634 |
> > This is a paragraph in a nested blockquote. |
| 635 |
> |
| 636 |
> Back to the first level.</pre> |
| 637 |
</div> |
| 638 |
|
| 639 |
<div class="case" data-name="html in blockquote"> |
| 640 |
<div class="input"> |
| 641 |
<blockquote> |
| 642 |
<h2>This is a header.</h2> |
| 643 |
<ol> |
| 644 |
<li>This is the first list item.</li> |
| 645 |
<li>This is the second list item.</li> |
| 646 |
</ol> |
| 647 |
<p>A code block:</p> |
| 648 |
<pre><code>return 1 < 2 ? shell_exec('echo $input | $markdown_script') : 0;</code></pre> |
| 649 |
</blockquote> |
| 650 |
</div> |
| 651 |
<pre class="expected">> This is a header. |
| 652 |
> ----------------- |
| 653 |
> |
| 654 |
> 1. This is the first list item. |
| 655 |
> 2. This is the second list item. |
| 656 |
> |
| 657 |
> A code block: |
| 658 |
> |
| 659 |
> return 1 < 2 ? shell_exec('echo $input | $markdown_script') : 0;</pre> |
| 660 |
</div> |
| 661 |
|
| 662 |
<div class="case" data-name="multiple divs"> |
| 663 |
<div class="input"> |
| 664 |
<div>A div</div> |
| 665 |
<div>Another div</div> |
| 666 |
</div> |
| 667 |
<pre class="expected">A div |
| 668 |
|
| 669 |
Another div</pre> |
| 670 |
</div> |
| 671 |
|
| 672 |
<div class="case" data-name="multiple divs"> |
| 673 |
<div class="input"> |
| 674 |
<div>A div</div> |
| 675 |
<div>Another div</div> |
| 676 |
</div> |
| 677 |
<pre class="expected">A div |
| 678 |
|
| 679 |
Another div</pre> |
| 680 |
</div> |
| 681 |
|
| 682 |
<div class="case" data-name="comment"> |
| 683 |
<div class="input"></div> |
| 684 |
<pre class="expected"></pre> |
| 685 |
</div> |
| 686 |
|
| 687 |
<div class="case" data-name="pre/code with comment"> |
| 688 |
<div class="input"> |
| 689 |
<pre ><code>Hello world</code></pre> |
| 690 |
</div> |
| 691 |
<pre class="expected"> Hello world</pre> |
| 692 |
</div> |
| 693 |
|
| 694 |
<div class="case" data-name="leading whitespace in heading"> |
| 695 |
<div class="input"><h3> |
| 696 |
h3 with leading whitespace</h3></div> |
| 697 |
<pre class="expected">### h3 with leading whitespace</pre> |
| 698 |
</div> |
| 699 |
|
| 700 |
<div class="case" data-name="trailing whitespace in li"> |
| 701 |
<div class="input"> |
| 702 |
<ol> |
| 703 |
<li>Chapter One |
| 704 |
<ol> |
| 705 |
<li>Section One</li> |
| 706 |
<li>Section Two with trailing whitespace </li> |
| 707 |
<li>Section Three with trailing whitespace </li> |
| 708 |
</ol> |
| 709 |
</li> |
| 710 |
<li>Chapter Two</li> |
| 711 |
<li>Chapter Three with trailing whitespace </li> |
| 712 |
</ol> |
| 713 |
</div> |
| 714 |
<pre class="expected">1. Chapter One |
| 715 |
1. Section One |
| 716 |
2. Section Two with trailing whitespace |
| 717 |
3. Section Three with trailing whitespace |
| 718 |
2. Chapter Two |
| 719 |
3. Chapter Three with trailing whitespace</pre> |
| 720 |
</div> |
| 721 |
|
| 722 |
<div class="case" data-name="multilined and bizarre formatting"> |
| 723 |
<div class="input"> |
| 724 |
<ul> |
| 725 |
<li> |
| 726 |
Indented li with leading/trailing newlines |
| 727 |
</li> |
| 728 |
<li> |
| 729 |
<strong>Strong with trailing space inside li with leading/trailing whitespace </strong> </li> |
| 730 |
<li>li without whitespace</li> |
| 731 |
<li> Leading space, text, lots of whitespace … |
| 732 |
text |
| 733 |
</li> |
| 734 |
</ol> |
| 735 |
</div> |
| 736 |
<pre class="expected">* Indented li with leading/trailing newlines |
| 737 |
* **Strong with trailing space inside li with leading/trailing whitespace** |
| 738 |
* li without whitespace |
| 739 |
* Leading space, text, lots of whitespace … text</pre> |
| 740 |
</div> |
| 741 |
|
| 742 |
<div class="case" data-name="whitespace between inline elements"> |
| 743 |
<div class="input"> |
| 744 |
<p>I <a href="http://example.com/need">need</a> <a href="http://www.example.com/more">more</a> spaces!</p> |
| 745 |
</div> |
| 746 |
<pre class="expected">I [need](http://example.com/need) [more](http://www.example.com/more) spaces!</pre> |
| 747 |
</div> |
| 748 |
|
| 749 |
<div class="case" data-name="whitespace in inline elements"> |
| 750 |
<div class="input">Text with no space after the period.<em> Text in em with leading/trailing spaces </em><strong>text in strong with trailing space </strong></div> |
| 751 |
<pre class="expected">Text with no space after the period. _Text in em with leading/trailing spaces_ **text in strong with trailing space**</pre> |
| 752 |
</div> |
| 753 |
|
| 754 |
<div class="case" data-name="whitespace in nested inline elements"> |
| 755 |
<div class="input">Text at root <strong><a href="http://www.example.com">link text with trailing space in strong </a></strong>more text at root</div> |
| 756 |
<pre class="expected">Text at root **[link text with trailing space in strong](http://www.example.com)** more text at root</pre> |
| 757 |
</div> |
| 758 |
|
| 759 |
<div class="case" data-name="blank inline elements"> |
| 760 |
<div class="input"> |
| 761 |
Text before blank em … <em></em> text after blank em |
| 762 |
</div> |
| 763 |
<pre class="expected">Text before blank em … text after blank em</pre> |
| 764 |
</div> |
| 765 |
|
| 766 |
<div class="case" data-name="blank block elements"> |
| 767 |
<div class="input"> |
| 768 |
Text before blank div … <div></div> text after blank div |
| 769 |
</div> |
| 770 |
<pre class="expected">Text before blank div … |
| 771 |
|
| 772 |
text after blank div</pre> |
| 773 |
</div> |
| 774 |
|
| 775 |
<div class="case" data-name="blank inline element with br"> |
| 776 |
<div class="input"><strong><br></strong></div> |
| 777 |
<pre class="expected"></pre> |
| 778 |
</div> |
| 779 |
|
| 780 |
<div class="case" data-name="whitespace between blocks"> |
| 781 |
<div class="input"><div><div>Content in a nested div</div></div> |
| 782 |
<div>Content in another div</div></div> |
| 783 |
<pre class="expected">Content in a nested div |
| 784 |
|
| 785 |
Content in another div</pre> |
| 786 |
</div> |
| 787 |
|
| 788 |
<div class="case" data-name="escaping backslashes"> |
| 789 |
<div class="input">backslash \</div> |
| 790 |
<pre class="expected">backslash \\</pre> |
| 791 |
</div> |
| 792 |
|
| 793 |
<div class="case" data-name="escaping headings with #"> |
| 794 |
<div class="input">### This is not a heading</div> |
| 795 |
<pre class="expected">\### This is not a heading</pre> |
| 796 |
</div> |
| 797 |
|
| 798 |
<div class="case" data-name="not escaping # outside of a heading"> |
| 799 |
<div class="input">#This is not # a heading</div> |
| 800 |
<pre class="expected">#This is not # a heading</pre> |
| 801 |
</div> |
| 802 |
|
| 803 |
<div class="case" data-name="escaping em markdown with *"> |
| 804 |
<div class="input">To add emphasis, surround text with *. For example: *this is emphasis*</div> |
| 805 |
<pre class="expected">To add emphasis, surround text with \*. For example: \*this is emphasis\*</pre> |
| 806 |
</div> |
| 807 |
|
| 808 |
<div class="case" data-name="escaping em markdown with _"> |
| 809 |
<div class="input">To add emphasis, surround text with _. For example: _this is emphasis_</div> |
| 810 |
<pre class="expected">To add emphasis, surround text with \_. For example: \_this is emphasis\_</pre> |
| 811 |
</div> |
| 812 |
|
| 813 |
<div class="case" data-name="not escaping within code"> |
| 814 |
<div class="input"><pre><code>def this_is_a_method; end;</code></pre></div> |
| 815 |
<pre class="expected"> def this_is_a_method; end;</pre> |
| 816 |
</div> |
| 817 |
|
| 818 |
<div class="case" data-name="escaping strong markdown with *"> |
| 819 |
<div class="input">To add strong emphasis, surround text with **. For example: **this is strong**</div> |
| 820 |
<pre class="expected">To add strong emphasis, surround text with \*\*. For example: \*\*this is strong\*\*</pre> |
| 821 |
</div> |
| 822 |
|
| 823 |
<div class="case" data-name="escaping strong markdown with _"> |
| 824 |
<div class="input">To add strong emphasis, surround text with __. For example: __this is strong__</div> |
| 825 |
<pre class="expected">To add strong emphasis, surround text with \_\_. For example: \_\_this is strong\_\_</pre> |
| 826 |
</div> |
| 827 |
|
| 828 |
<div class="case" data-name="escaping hr markdown with *"> |
| 829 |
<div class="input">* * *</div> |
| 830 |
<pre class="expected">\* \* \*</pre> |
| 831 |
</div> |
| 832 |
|
| 833 |
<div class="case" data-name="escaping hr markdown with -"> |
| 834 |
<div class="input">- - -</div> |
| 835 |
<pre class="expected">\- - -</pre> |
| 836 |
</div> |
| 837 |
|
| 838 |
<div class="case" data-name="escaping hr markdown with _"> |
| 839 |
<div class="input">_ _ _</div> |
| 840 |
<pre class="expected">\_ \_ \_</pre> |
| 841 |
</div> |
| 842 |
|
| 843 |
<div class="case" data-name="escaping hr markdown without spaces"> |
| 844 |
<div class="input">***</div> |
| 845 |
<pre class="expected">\*\*\*</pre> |
| 846 |
</div> |
| 847 |
|
| 848 |
<div class="case" data-name="escaping hr markdown with more than 3 characters"> |
| 849 |
<div class="input">* * * * *</div> |
| 850 |
<pre class="expected">\* \* \* \* \*</pre> |
| 851 |
</div> |
| 852 |
|
| 853 |
<div class="case" data-name="escaping ol markdown"> |
| 854 |
<div class="input">1984. by George Orwell</div> |
| 855 |
<pre class="expected">1984\. by George Orwell</pre> |
| 856 |
</div> |
| 857 |
|
| 858 |
<div class="case" data-name="not escaping . outside of an ol"> |
| 859 |
<div class="input">1984.George Orwell wrote 1984.</div> |
| 860 |
<pre class="expected">1984.George Orwell wrote 1984.</pre> |
| 861 |
</div> |
| 862 |
|
| 863 |
<div class="case" data-name="escaping ul markdown *"> |
| 864 |
<div class="input">* An unordered list item</div> |
| 865 |
<pre class="expected">\* An unordered list item</pre> |
| 866 |
</div> |
| 867 |
|
| 868 |
<div class="case" data-name="escaping ul markdown -"> |
| 869 |
<div class="input">- An unordered list item</div> |
| 870 |
<pre class="expected">\- An unordered list item</pre> |
| 871 |
</div> |
| 872 |
|
| 873 |
<div class="case" data-name="escaping ul markdown +"> |
| 874 |
<div class="input">+ An unordered list item</div> |
| 875 |
<pre class="expected">\+ An unordered list item</pre> |
| 876 |
</div> |
| 877 |
|
| 878 |
<div class="case" data-name="not escaping - outside of a ul"> |
| 879 |
<div class="input">Hello-world, 45 - 3 is 42</div> |
| 880 |
<pre class="expected">Hello-world, 45 - 3 is 42</pre> |
| 881 |
</div> |
| 882 |
|
| 883 |
<div class="case" data-name="not escaping + outside of a ul"> |
| 884 |
<div class="input">+1 and another +</div> |
| 885 |
<pre class="expected">+1 and another +</pre> |
| 886 |
</div> |
| 887 |
|
| 888 |
<div class="case" data-name="escaping *"> |
| 889 |
<div class="input">You can use * for multiplication</div> |
| 890 |
<pre class="expected">You can use \* for multiplication</pre> |
| 891 |
</div> |
| 892 |
|
| 893 |
<div class="case" data-name="escaping ** inside strong tags"> |
| 894 |
<div class="input"><strong>**test</strong></div> |
| 895 |
<pre class="expected">**\*\*test**</pre> |
| 896 |
</div> |
| 897 |
|
| 898 |
<div class="case" data-name="escaping _ inside em tags"> |
| 899 |
<div class="input"><em>test_italics</em></div> |
| 900 |
<pre class="expected">_test\_italics_</pre> |
| 901 |
</div> |
| 902 |
|
| 903 |
<div class="case" data-name="escaping > as blockquote"> |
| 904 |
<div class="input">> Blockquote in markdown</div> |
| 905 |
<pre class="expected">\> Blockquote in markdown</pre> |
| 906 |
</div> |
| 907 |
|
| 908 |
<div class="case" data-name="escaping > as blockquote without space"> |
| 909 |
<div class="input">>Blockquote in markdown</div> |
| 910 |
<pre class="expected">\>Blockquote in markdown</pre> |
| 911 |
</div> |
| 912 |
|
| 913 |
<div class="case" data-name="not escaping > outside of a blockquote"> |
| 914 |
<div class="input">42 > 1</div> |
| 915 |
<pre class="expected">42 > 1</pre> |
| 916 |
</div> |
| 917 |
|
| 918 |
<div class="case" data-name="escaping code"> |
| 919 |
<div class="input">`not code`</div> |
| 920 |
<pre class="expected">\`not code\`</pre> |
| 921 |
</div> |
| 922 |
|
| 923 |
<div class="case" data-name="escaping []"> |
| 924 |
<div class="input">[This] is a sentence with brackets</div> |
| 925 |
<pre class="expected">\[This\] is a sentence with brackets</pre> |
| 926 |
</div> |
| 927 |
|
| 928 |
<div class="case" data-name="escaping ["> |
| 929 |
<div class="input"><a href="http://www.example.com">c[iao</a></div> |
| 930 |
<pre class="expected">[c\[iao](http://www.example.com)</pre> |
| 931 |
</div> |
| 932 |
|
| 933 |
|
| 934 |
<div class="case" data-name="escaping * performance"> |
| 935 |
<div class="input">fasdf *883 asdf wer qweasd fsd asdf asdfaqwe rqwefrsdf</div> |
| 936 |
<pre class="expected">fasdf \*883 asdf wer qweasd fsd asdf asdfaqwe rqwefrsdf</pre> |
| 937 |
</div> |
| 938 |
|
| 939 |
<div class="case" data-name="escaping multiple asterisks"> |
| 940 |
<div class="input"><p>* * ** It aims to be*</p></div> |
| 941 |
<pre class="expected">\* \* \*\* It aims to be\*</pre> |
| 942 |
</div> |
| 943 |
|
| 944 |
<div class="case" data-name="escaping delimiters around short words and numbers"> |
| 945 |
<div class="input"><p>_Really_? Is that what it _is_? A **2000** year-old computer?</p></div> |
| 946 |
<pre class="expected">\_Really\_? Is that what it \_is\_? A \*\*2000\*\* year-old computer?</pre> |
| 947 |
</div> |
| 948 |
|
| 949 |
<div class="case" data-name="non-markdown block elements"> |
| 950 |
<div class="input"> |
| 951 |
Foo |
| 952 |
<div>Bar</div> |
| 953 |
Baz |
| 954 |
</div> |
| 955 |
<pre class="expected">Foo |
| 956 |
|
| 957 |
Bar |
| 958 |
|
| 959 |
Baz</pre> |
| 960 |
</div> |
| 961 |
|
| 962 |
<div class="case" data-name="non-markdown inline elements"> |
| 963 |
<div class="input"> |
| 964 |
Foo <span>Bar</span> |
| 965 |
</div> |
| 966 |
<pre class="expected">Foo Bar</pre> |
| 967 |
</div> |
| 968 |
|
| 969 |
<div class="case" data-name="blank inline elements"> |
| 970 |
<div class="input"> |
| 971 |
Hello <em></em>world |
| 972 |
</div> |
| 973 |
<pre class="expected">Hello world</pre> |
| 974 |
</div> |
| 975 |
|
| 976 |
<div class="case" data-name="elements with a single void element"> |
| 977 |
<div class="input"> |
| 978 |
<p><img src="http://example.com/logo.png" /></p> |
| 979 |
</div> |
| 980 |
<pre class="expected"></pre> |
| 981 |
</div> |
| 982 |
|
| 983 |
<div class="case" data-name="elements with a nested void element"> |
| 984 |
<div class="input"> |
| 985 |
<p><span><img src="http://example.com/logo.png" /></span></p> |
| 986 |
</div> |
| 987 |
<pre class="expected"></pre> |
| 988 |
</div> |
| 989 |
|
| 990 |
<div class="case" data-name="text separated by a space in an element"> |
| 991 |
<div class="input"> |
| 992 |
<p>Foo<span> </span>Bar</p> |
| 993 |
</div> |
| 994 |
<pre class="expected">Foo Bar</pre> |
| 995 |
</div> |
| 996 |
|
| 997 |
<div class="case" data-name="text separated by a non-breaking space in an element"> |
| 998 |
<div class="input"> |
| 999 |
<p>Foo<span> </span>Bar</p> |
| 1000 |
</div> |
| 1001 |
<pre class="expected">Foo Bar</pre> |
| 1002 |
</div> |
| 1003 |
|
| 1004 |
<div class="case" data-name="triple tildes inside code" data-options='{"codeBlockStyle": "fenced", "fence": "~~~"}'> |
| 1005 |
<div class="input"> |
| 1006 |
<pre><code>~~~ |
| 1007 |
Code |
| 1008 |
~~~ |
| 1009 |
</code></pre> |
| 1010 |
</div> |
| 1011 |
<pre class="expected">~~~~ |
| 1012 |
~~~ |
| 1013 |
Code |
| 1014 |
~~~ |
| 1015 |
~~~~</pre> |
| 1016 |
</div> |
| 1017 |
|
| 1018 |
<div class="case" data-name="triple ticks inside code" data-options='{"codeBlockStyle": "fenced", "fence": "```"}'> |
| 1019 |
<div class="input"> |
| 1020 |
<pre><code>``` |
| 1021 |
Code |
| 1022 |
``` |
| 1023 |
</code></pre> |
| 1024 |
</div> |
| 1025 |
<pre class="expected">```` |
| 1026 |
``` |
| 1027 |
Code |
| 1028 |
``` |
| 1029 |
````</pre> |
| 1030 |
</div> |
| 1031 |
|
| 1032 |
<div class="case" data-name="four ticks inside code" data-options='{"codeBlockStyle": "fenced", "fence": "```"}'> |
| 1033 |
<div class="input"> |
| 1034 |
<pre><code>```` |
| 1035 |
Code |
| 1036 |
```` |
| 1037 |
</code></pre> |
| 1038 |
</div> |
| 1039 |
<pre class="expected">````` |
| 1040 |
```` |
| 1041 |
Code |
| 1042 |
```` |
| 1043 |
`````</pre> |
| 1044 |
</div> |
| 1045 |
|
| 1046 |
<div class="case" data-name="empty line in start/end of code block" data-options='{"codeBlockStyle": "fenced", "fence": "```"}'> |
| 1047 |
<div class="input"> |
| 1048 |
<pre><code> |
| 1049 |
Code |
| 1050 |
|
| 1051 |
</code></pre> |
| 1052 |
</div> |
| 1053 |
<pre class="expected">``` |
| 1054 |
|
| 1055 |
Code |
| 1056 |
|
| 1057 |
```</pre> |
| 1058 |
</div> |
| 1059 |
|
| 1060 |
<div class="case" data-name="text separated by ASCII and nonASCII space in an element"> |
| 1061 |
<div class="input"> |
| 1062 |
<p>Foo<span> </span>Bar</p> |
| 1063 |
</div> |
| 1064 |
<pre class="expected">Foo Bar</pre> |
| 1065 |
</div> |
| 1066 |
|
| 1067 |
<div class="case" data-name="list-like text with non-breaking spaces"> |
| 1068 |
<div class="input"> 1. First<br> 2. Second</div> |
| 1069 |
<pre class="expected"> 1. First |
| 1070 |
2. Second</pre> |
| 1071 |
</div> |
| 1072 |
|
| 1073 |
<div class="case" data-name="element with trailing nonASCII WS followed by nonWS"> |
| 1074 |
<div class="input"><i>foo </i>bar</div> |
| 1075 |
<pre class="expected">_foo_ bar</pre> |
| 1076 |
</div> |
| 1077 |
|
| 1078 |
<div class="case" data-name="element with trailing nonASCII WS followed by nonASCII WS"> |
| 1079 |
<div class="input"><i>foo </i> bar</div> |
| 1080 |
<pre class="expected">_foo_ bar</pre> |
| 1081 |
</div> |
| 1082 |
|
| 1083 |
<div class="case" data-name="element with trailing ASCII WS followed by nonASCII WS"> |
| 1084 |
<div class="input"><i>foo </i> bar</div> |
| 1085 |
<pre class="expected">_foo_ bar</pre> |
| 1086 |
</div> |
| 1087 |
|
| 1088 |
<div class="case" data-name="element with trailing nonASCII WS followed by ASCII WS"> |
| 1089 |
<div class="input"><i>foo </i> bar</div> |
| 1090 |
<pre class="expected">_foo_ bar</pre> |
| 1091 |
</div> |
| 1092 |
|
| 1093 |
<div class="case" data-name="nonWS followed by element with leading nonASCII WS"> |
| 1094 |
<div class="input">foo<i> bar</i></div> |
| 1095 |
<pre class="expected">foo _bar_</pre> |
| 1096 |
</div> |
| 1097 |
|
| 1098 |
<div class="case" data-name="nonASCII WS followed by element with leading nonASCII WS"> |
| 1099 |
<div class="input">foo <i> bar</i></div> |
| 1100 |
<pre class="expected">foo _bar_</pre> |
| 1101 |
</div> |
| 1102 |
|
| 1103 |
<div class="case" data-name="nonASCII WS followed by element with leading ASCII WS"> |
| 1104 |
<div class="input">foo <i> bar</i></div> |
| 1105 |
<pre class="expected">foo _bar_</pre> |
| 1106 |
</div> |
| 1107 |
|
| 1108 |
<div class="case" data-name="ASCII WS followed by element with leading nonASCII WS"> |
| 1109 |
<div class="input">foo <i> bar</i></div> |
| 1110 |
<pre class="expected">foo _bar_</pre> |
| 1111 |
</div> |
| 1112 |
|
| 1113 |
|
| 1114 |
<div class="case" data-name="preformatted code with leading whitespace" data-options='{"preformattedCode": true}'> |
| 1115 |
<div class="input">Four spaces <code> make an indented code block in Markdown</code></div> |
| 1116 |
<pre class="expected">Four spaces ` make an indented code block in Markdown`</pre> |
| 1117 |
</div> |
| 1118 |
|
| 1119 |
<div class="case" data-name="preformatted code with trailing whitespace" data-options='{"preformattedCode": true}'> |
| 1120 |
<div class="input"><code>A line break </code> <b> note the spaces</b></div> |
| 1121 |
<pre class="expected">`A line break ` **note the spaces**</pre> |
| 1122 |
</div> |
| 1123 |
|
| 1124 |
<div class="case" data-name="preformatted code tightly surrounded" data-options='{"preformattedCode": true}'> |
| 1125 |
<div class="input"><b>tight</b><code>code</code><b>wrap</b></div> |
| 1126 |
<pre class="expected">**tight**`code`**wrap**</pre> |
| 1127 |
</div> |
| 1128 |
|
| 1129 |
<div class="case" data-name="preformatted code loosely surrounded" data-options='{"preformattedCode": true}'> |
| 1130 |
<div class="input"><b>not so tight </b><code>code</code><b> wrap</b></div> |
| 1131 |
<pre class="expected">**not so tight** `code` **wrap**</pre> |
| 1132 |
</div> |
| 1133 |
|
| 1134 |
|
| 1135 |
<div class="case" data-name="preformatted code with newlines" data-options='{"preformattedCode": true}'> |
| 1136 |
<div class="input"> |
| 1137 |
<code> |
| 1138 |
|
| 1139 |
nasty |
| 1140 |
code |
| 1141 |
|
| 1142 |
</code> |
| 1143 |
</div> |
| 1144 |
<pre class="expected">` nasty code `</pre> |
| 1145 |
</div> |
| 1146 |
|
| 1147 |
|
| 1148 |
|
| 1149 |
<script src="turndown-test.browser.js"></script> |
| 1150 |
</body> |
| 1151 |
</html> |