| 1 |
# The parsoid-compatible option below is only relevant when we are running |
| 2 |
# parser tests in integrated mode with Parsoid. This option is ignored |
| 3 |
# when this test file is run with Parsoid in standalone mode. |
| 4 |
!! options |
| 5 |
parsoid-compatible=wt2html,wt2wt |
| 6 |
version=2 |
| 7 |
!! end |
| 8 |
|
| 9 |
!! article |
| 10 |
Template:1x |
| 11 |
!! text |
| 12 |
{{{1}}} |
| 13 |
!! endarticle |
| 14 |
|
| 15 |
!! article |
| 16 |
Template:definition_list |
| 17 |
!! text |
| 18 |
one |
| 19 |
::two |
| 20 |
!! endarticle |
| 21 |
|
| 22 |
!! article |
| 23 |
Help:FAQ |
| 24 |
!! text |
| 25 |
help! |
| 26 |
!! end |
| 27 |
|
| 28 |
!! test |
| 29 |
Simple definition |
| 30 |
!! options |
| 31 |
parsoid=wt2html,html2html |
| 32 |
!! wikitext |
| 33 |
;name :Definition |
| 34 |
!! html |
| 35 |
<dl><dt>name</dt> |
| 36 |
<dd>Definition</dd></dl> |
| 37 |
!! end |
| 38 |
|
| 39 |
!! test |
| 40 |
Definition list for indentation only |
| 41 |
!! wikitext |
| 42 |
:Indented text |
| 43 |
!! html |
| 44 |
<dl><dd>Indented text</dd></dl> |
| 45 |
!! end |
| 46 |
|
| 47 |
!! test |
| 48 |
Definition list with no space |
| 49 |
!! wikitext |
| 50 |
;name:Definition |
| 51 |
!! html |
| 52 |
<dl><dt>name</dt> |
| 53 |
<dd>Definition</dd></dl> |
| 54 |
!!end |
| 55 |
|
| 56 |
!! test |
| 57 |
Definition list with URL link |
| 58 |
!! options |
| 59 |
parsoid=wt2html,html2html |
| 60 |
!! wikitext |
| 61 |
;http://example.com/ :definition |
| 62 |
!! html/php |
| 63 |
<dl><dt><a rel="nofollow" class="external free" href="http://example.com/">http://example.com/</a></dt> |
| 64 |
<dd>definition</dd></dl> |
| 65 |
!! html/parsoid |
| 66 |
<dl><dt><a rel="mw:ExtLink" href="http://example.com/" class="external free">http://example.com/</a></dt><dd data-parsoid='{"stx":"row"}'>definition</dd></dl> |
| 67 |
!! end |
| 68 |
|
| 69 |
!! test |
| 70 |
Definition list with bracketed URL link |
| 71 |
!! wikitext |
| 72 |
;[http://www.example.com/ Example]:Something about it |
| 73 |
!! html |
| 74 |
<dl><dt><a rel="nofollow" class="external text" href="http://www.example.com/">Example</a></dt> |
| 75 |
<dd>Something about it</dd></dl> |
| 76 |
!! end |
| 77 |
|
| 78 |
!! test |
| 79 |
Definition list with wikilink containing colon |
| 80 |
!! wikitext |
| 81 |
;[[Help:FAQ]]:The least-read page on Wikipedia |
| 82 |
!! html/php |
| 83 |
<dl><dt><a href="/wiki/Help:FAQ" title="Help:FAQ">Help:FAQ</a></dt> |
| 84 |
<dd>The least-read page on Wikipedia</dd></dl> |
| 85 |
!! html/parsoid |
| 86 |
<dl><dt><a rel="mw:WikiLink" href="./Help:FAQ" title="Help:FAQ" data-parsoid='{"stx":"simple","a":{"href":"./Help:FAQ"},"sa":{"href":"Help:FAQ"}}'>Help:FAQ</a></dt><dd data-parsoid='{"stx":"row"}'>The least-read page on Wikipedia</dd></dl> |
| 87 |
!! end |
| 88 |
|
| 89 |
# At Brooke's and JeLuF's insistence... :) |
| 90 |
!! test |
| 91 |
Definition list with news link containing colon |
| 92 |
!! options |
| 93 |
parsoid=wt2html,html2html |
| 94 |
!! wikitext |
| 95 |
;news:alt.wikipedia.rox :This isn't even a real newsgroup! |
| 96 |
!! html/php |
| 97 |
<dl><dt><a rel="nofollow" class="external free" href="news:alt.wikipedia.rox">news:alt.wikipedia.rox</a></dt> |
| 98 |
<dd>This isn't even a real newsgroup!</dd></dl> |
| 99 |
!! html/parsoid |
| 100 |
<dl><dt><a rel="mw:ExtLink" href="news:alt.wikipedia.rox" class="external free" data-parsoid='{"stx":"url"}'>news:alt.wikipedia.rox</a></dt><dd data-parsoid='{"stx":"row"}'>This isn't even a real newsgroup!</dd></dl> |
| 101 |
!! end |
| 102 |
|
| 103 |
!! test |
| 104 |
Malformed definition list with colon |
| 105 |
!! wikitext |
| 106 |
;news:alt.wikipedia.rox -- don't crash or enter an infinite loop |
| 107 |
!! html |
| 108 |
<dl><dt><a rel="nofollow" class="external free" href="news:alt.wikipedia.rox">news:alt.wikipedia.rox</a> -- don't crash or enter an infinite loop</dt></dl> |
| 109 |
!! end |
| 110 |
|
| 111 |
!! test |
| 112 |
Definition lists: colon in external link text |
| 113 |
!! options |
| 114 |
parsoid=wt2html,html2html |
| 115 |
!! wikitext |
| 116 |
;[http://www.wikipedia2.org/ Wikipedia :The Next Generation] :OK, I made that up |
| 117 |
!! html/php |
| 118 |
<dl><dt><a rel="nofollow" class="external text" href="http://www.wikipedia2.org/">Wikipedia :The Next Generation</a></dt> |
| 119 |
<dd>OK, I made that up</dd></dl> |
| 120 |
!! html/parsoid |
| 121 |
<dl><dt><a rel="mw:ExtLink" href="http://www.wikipedia2.org/" class="external text">Wikipedia :The Next Generation</a></dt><dd data-parsoid='{"stx":"row"}'>OK, I made that up</dd></dl> |
| 122 |
!! end |
| 123 |
|
| 124 |
!! test |
| 125 |
Definition lists: colon in HTML attribute |
| 126 |
!! wikitext |
| 127 |
;<b style="display: inline">bold</b> |
| 128 |
!! html |
| 129 |
<dl><dt><b style="display: inline">bold</b></dt></dl> |
| 130 |
!! end |
| 131 |
|
| 132 |
!! test |
| 133 |
Definition lists: self-closed tag |
| 134 |
!! options |
| 135 |
parsoid=wt2html,html2html |
| 136 |
!! wikitext |
| 137 |
;one<br/>two :two-line fun |
| 138 |
!! html |
| 139 |
<dl><dt>one<br />two</dt> |
| 140 |
<dd>two-line fun</dd></dl> |
| 141 |
!! end |
| 142 |
|
| 143 |
!! test |
| 144 |
Definition lists: ignore colons inside tags |
| 145 |
!! wikitext |
| 146 |
;one <b>two : tag <i>fun:</i>:</b>:def |
| 147 |
!! html |
| 148 |
<dl><dt>one <b>two : tag <i>fun:</i>:</b></dt> |
| 149 |
<dd>def</dd></dl> |
| 150 |
!! end |
| 151 |
|
| 152 |
!! test |
| 153 |
Definition lists: excess closed tags |
| 154 |
!! options |
| 155 |
parsoid=wt2html,html2html |
| 156 |
!! wikitext |
| 157 |
;one</b>two :bad tag fun |
| 158 |
!! html/php |
| 159 |
<dl><dt>onetwo</dt> |
| 160 |
<dd>bad tag fun</dd></dl> |
| 161 |
!! html/parsoid |
| 162 |
<dl><dt>one<meta typeof="mw:Placeholder/StrippedTag" data-parsoid='{"src":"</b>","name":"b"}'/>two</dt><dd data-parsoid='{"stx":"row"}'>bad tag fun</dd></dl> |
| 163 |
!! end |
| 164 |
|
| 165 |
!! test |
| 166 |
T13748: Literal closing tags |
| 167 |
!! wikitext |
| 168 |
<dl> |
| 169 |
<dt>test 1</dt> |
| 170 |
<dd>test test test test test</dd> |
| 171 |
<dt>test 2</dt> |
| 172 |
<dd>test test test test test</dd> |
| 173 |
</dl> |
| 174 |
!! html |
| 175 |
<dl> |
| 176 |
<dt>test 1</dt> |
| 177 |
<dd>test test test test test</dd> |
| 178 |
<dt>test 2</dt> |
| 179 |
<dd>test test test test test</dd> |
| 180 |
</dl> |
| 181 |
!! end |
| 182 |
|
| 183 |
!! test |
| 184 |
Definition and unordered list using wiki syntax nested in unordered list using html tags. |
| 185 |
!! options |
| 186 |
parsoid=wt2html,html2html |
| 187 |
!! wikitext |
| 188 |
<ul><li> |
| 189 |
;term :description |
| 190 |
*unordered |
| 191 |
</li></ul> |
| 192 |
!! html |
| 193 |
<ul><li> |
| 194 |
<dl><dt>term</dt> |
| 195 |
<dd>description</dd></dl> |
| 196 |
<ul><li>unordered</li></ul> |
| 197 |
</li></ul> |
| 198 |
!! end |
| 199 |
|
| 200 |
!! test |
| 201 |
Definition list with empty definition and following paragraph |
| 202 |
!! wikitext |
| 203 |
;term: |
| 204 |
|
| 205 |
Paragraph text |
| 206 |
!! html |
| 207 |
<dl><dt>term</dt> |
| 208 |
<dd></dd></dl> |
| 209 |
<p>Paragraph text |
| 210 |
</p> |
| 211 |
!! end |
| 212 |
|
| 213 |
!! test |
| 214 |
Nested definition lists using html syntax |
| 215 |
!! wikitext |
| 216 |
<dl><dt>x</dt> |
| 217 |
<dd>a</dd> |
| 218 |
<dd>b</dd></dl> |
| 219 |
!! html |
| 220 |
<dl><dt>x</dt> |
| 221 |
<dd>a</dd> |
| 222 |
<dd>b</dd></dl> |
| 223 |
!! end |
| 224 |
|
| 225 |
!! test |
| 226 |
Definition Lists: No nesting: Multiple dd's |
| 227 |
!! wikitext |
| 228 |
;x |
| 229 |
:a |
| 230 |
:b |
| 231 |
!! html |
| 232 |
<dl><dt>x</dt> |
| 233 |
<dd>a</dd> |
| 234 |
<dd>b</dd></dl> |
| 235 |
!! end |
| 236 |
|
| 237 |
!! test |
| 238 |
Definition Lists: Indentation: Regular |
| 239 |
!! wikitext |
| 240 |
:i1 |
| 241 |
::i2 |
| 242 |
:::i3 |
| 243 |
!! html |
| 244 |
<dl><dd>i1 |
| 245 |
<dl><dd>i2 |
| 246 |
<dl><dd>i3</dd></dl></dd></dl></dd></dl> |
| 247 |
!! end |
| 248 |
|
| 249 |
!! test |
| 250 |
Definition Lists: Indentation: Missing 1st level |
| 251 |
!! wikitext |
| 252 |
::i2 |
| 253 |
:::i3 |
| 254 |
!! html |
| 255 |
<dl><dd><dl><dd>i2 |
| 256 |
<dl><dd>i3</dd></dl></dd></dl></dd></dl> |
| 257 |
!! end |
| 258 |
|
| 259 |
!! test |
| 260 |
Definition Lists: Indentation: Multi-level indent |
| 261 |
!! wikitext |
| 262 |
:::i3 |
| 263 |
!! html |
| 264 |
<dl><dd><dl><dd><dl><dd>i3</dd></dl></dd></dl></dd></dl> |
| 265 |
!! end |
| 266 |
|
| 267 |
!! test |
| 268 |
Definition Lists: Hacky use to indent tables |
| 269 |
!! wikitext |
| 270 |
::{| |
| 271 |
|foo |
| 272 |
|bar |
| 273 |
|} |
| 274 |
this text |
| 275 |
should be left alone |
| 276 |
!! html |
| 277 |
<dl><dd><dl><dd><table> |
| 278 |
<tbody><tr> |
| 279 |
<td>foo |
| 280 |
</td> |
| 281 |
<td>bar |
| 282 |
</td></tr></tbody></table></dd></dl></dd></dl> |
| 283 |
<p>this text |
| 284 |
should be left alone |
| 285 |
</p> |
| 286 |
!! end |
| 287 |
|
| 288 |
!! test |
| 289 |
Definition Lists: Hacky use to indent tables (with content following table) |
| 290 |
!! wikitext |
| 291 |
:{| |
| 292 |
|foo |
| 293 |
|bar |
| 294 |
|} <!--c1--> this text should be part of the dl |
| 295 |
!! html/php |
| 296 |
<dl><dd><table> |
| 297 |
<tbody><tr> |
| 298 |
<td>foo |
| 299 |
</td> |
| 300 |
<td>bar |
| 301 |
</td></tr></tbody></table> this text should be part of the dl</dd></dl> |
| 302 |
!! html/parsoid |
| 303 |
<dl><dd><table> |
| 304 |
<tbody><tr> |
| 305 |
<td>foo |
| 306 |
</td> |
| 307 |
<td>bar |
| 308 |
</td></tr></tbody></table> <!--c1--> this text should be part of the dl</dd></dl> |
| 309 |
!! end |
| 310 |
|
| 311 |
!! test |
| 312 |
Definition Lists: Hacky use to indent tables, with comments (T65979) |
| 313 |
!! wikitext |
| 314 |
<!-- foo --> |
| 315 |
::{| |
| 316 |
|foo |
| 317 |
|bar |
| 318 |
|}<!-- bar --> |
| 319 |
this text |
| 320 |
should be left alone |
| 321 |
!! html/parsoid |
| 322 |
<!-- foo --> |
| 323 |
<dl><dd><dl><dd><table><tr> |
| 324 |
<td>foo</td> |
| 325 |
<td>bar</td> |
| 326 |
</tr></table><!-- bar --></dd></dl></dd></dl> |
| 327 |
<p>this text |
| 328 |
should be left alone</p> |
| 329 |
!! end |
| 330 |
|
| 331 |
!! test |
| 332 |
Definition Lists: Hacky use to indent tables, with comment before table |
| 333 |
!!options |
| 334 |
parsoid=wt2html |
| 335 |
!! wikitext |
| 336 |
::<!-- foo -->{| |
| 337 |
|foo |
| 338 |
|} |
| 339 |
!! html/parsoid |
| 340 |
<dl><dd><dl><dd><!-- foo --><table><tr> |
| 341 |
<td>foo</td> |
| 342 |
</tr></table></dd></dl></dd></dl> |
| 343 |
!! end |
| 344 |
|
| 345 |
# Note that the legacy parser closes the list completely for the |
| 346 |
# hacky-indent table and then reopens it; Parsoid emits the "expected" |
| 347 |
# output. Parsoid team regards this as a bug in the legacy parser. |
| 348 |
!! test |
| 349 |
Definition Lists: Hack use to indent tables, in a nested list context (T262943) |
| 350 |
!! wikitext |
| 351 |
This is a discussion thread. |
| 352 |
|
| 353 |
:Parent comment. |
| 354 |
::Child comment |
| 355 |
::{| |
| 356 |
|With a |
| 357 |
|Table! |
| 358 |
|} |
| 359 |
!! html/php |
| 360 |
<p>This is a discussion thread. |
| 361 |
</p> |
| 362 |
<dl><dd>Parent comment. |
| 363 |
<dl><dd>Child comment</dd></dl></dd></dl> |
| 364 |
<dl><dd><dl><dd><table> |
| 365 |
<tbody><tr> |
| 366 |
<td>With a |
| 367 |
</td> |
| 368 |
<td>Table! |
| 369 |
</td></tr></tbody></table></dd></dl></dd></dl> |
| 370 |
!! html/parsoid |
| 371 |
<p>This is a discussion thread.</p> |
| 372 |
|
| 373 |
<dl><dd data-parsoid='{}'>Parent comment. |
| 374 |
<dl><dd data-parsoid='{}'>Child comment</dd> |
| 375 |
<dd data-parsoid='{}'><table> |
| 376 |
<tbody><tr data-parsoid='{"autoInsertedStart":true}'><td>With a</td> |
| 377 |
<td>Table!</td></tr> |
| 378 |
</tbody></table></dd></dl></dd></dl> |
| 379 |
!! end |
| 380 |
|
| 381 |
# The trailing whitespace in this test is to catch a regression in |
| 382 |
# Parsoid after T54473. |
| 383 |
!! test |
| 384 |
Definition Lists: Hacky use to indent tables (WS-insensitive) |
| 385 |
!! wikitext |
| 386 |
:{| |
| 387 |
|a |
| 388 |
|} |
| 389 |
!! html/php |
| 390 |
<dl><dd><table> |
| 391 |
<tbody><tr> |
| 392 |
<td>a |
| 393 |
</td></tr></tbody></table></dd></dl> |
| 394 |
!! html/parsoid |
| 395 |
<dl><dd><table> |
| 396 |
<tbody><tr><td>a</td></tr> |
| 397 |
</tbody></table></dd></dl> |
| 398 |
!! end |
| 399 |
|
| 400 |
# wt2wt / html2wt will normalize newlines - so disabled those test modes |
| 401 |
!! test |
| 402 |
Definition Lists: Hacky use to indent tables (nl-insensitive) |
| 403 |
!! options |
| 404 |
parsoid=wt2html,html2html |
| 405 |
!! wikitext |
| 406 |
:{| |
| 407 |
|
| 408 |
|
| 409 |
|a |
| 410 |
|} |
| 411 |
!! html/php |
| 412 |
<dl><dd><table> |
| 413 |
|
| 414 |
|
| 415 |
<tbody><tr> |
| 416 |
<td>a |
| 417 |
</td></tr></tbody></table></dd></dl> |
| 418 |
!! html/parsoid |
| 419 |
<dl><dd><table> |
| 420 |
<tbody><tr><td>a</td></tr> |
| 421 |
</tbody></table></dd></dl> |
| 422 |
!! end |
| 423 |
|
| 424 |
## The PHP parser treats : items (dd) without a corresponding ; item (dt) |
| 425 |
## as an empty dt item. It also ignores all but the last ";" when followed |
| 426 |
## by ":" later on. So, ";" are not ignored in ";;;t3" but are ignored in |
| 427 |
## ";;;t3 :d1". So, PHP parser behavior is a little inconsistent wrt multiple |
| 428 |
## ";"s. |
| 429 |
## |
| 430 |
## Ex: ";;t2 ::d2" is transformed into: |
| 431 |
## |
| 432 |
## <dl> |
| 433 |
## <dt>t2 </dt> |
| 434 |
## <dd> |
| 435 |
## <dl> |
| 436 |
## <dt></dt> |
| 437 |
## <dd>d2</dd> |
| 438 |
## </dl> |
| 439 |
## </dd> |
| 440 |
## </dl> |
| 441 |
## |
| 442 |
## But, Parsoid treats "; :" as a tight atomic unit and excess ":" as plain text |
| 443 |
## So, the same wikitext above (;;t2 ::d2) is transformed into: |
| 444 |
## |
| 445 |
## <dl> |
| 446 |
## <dt> |
| 447 |
## <dl> |
| 448 |
## <dt>t2 </dt> |
| 449 |
## <dd>:d2</dd> |
| 450 |
## </dl> |
| 451 |
## </dt> |
| 452 |
## </dl> |
| 453 |
## |
| 454 |
## All Parsoid only definition list tests have this difference. |
| 455 |
## |
| 456 |
## See also: https://phabricator.wikimedia.org/T8569 |
| 457 |
## and https://lists.wikimedia.org/pipermail/wikitext-l/2011-November/000483.html |
| 458 |
|
| 459 |
!! test |
| 460 |
Table / list interaction: indented table with lists in table contents |
| 461 |
!! wikitext |
| 462 |
:{| |
| 463 |
|- |
| 464 |
|a |
| 465 |
|
| 466 |
*b |
| 467 |
|- |
| 468 |
|c |
| 469 |
|
| 470 |
*d |
| 471 |
|} |
| 472 |
!! html |
| 473 |
<dl><dd><table> |
| 474 |
|
| 475 |
<tbody><tr> |
| 476 |
<td>a |
| 477 |
<ul><li>b</li></ul> |
| 478 |
</td></tr> |
| 479 |
<tr> |
| 480 |
<td>c |
| 481 |
<ul><li>d</li></ul> |
| 482 |
</td></tr></tbody></table></dd></dl> |
| 483 |
!! end |
| 484 |
|
| 485 |
!!test |
| 486 |
Table / list interaction: lists nested in tables nested in indented lists |
| 487 |
!! wikitext |
| 488 |
:{| |
| 489 |
| |
| 490 |
:a |
| 491 |
:b |
| 492 |
| |
| 493 |
*c |
| 494 |
*d |
| 495 |
|} |
| 496 |
|
| 497 |
*e |
| 498 |
*f |
| 499 |
!! html |
| 500 |
<dl><dd><table> |
| 501 |
<tbody><tr> |
| 502 |
<td> |
| 503 |
<dl><dd>a</dd> |
| 504 |
<dd>b</dd></dl> |
| 505 |
</td> |
| 506 |
<td> |
| 507 |
<ul><li>c</li> |
| 508 |
<li>d</li></ul> |
| 509 |
</td></tr></tbody></table></dd></dl> |
| 510 |
<ul><li>e</li> |
| 511 |
<li>f</li></ul> |
| 512 |
!!end |
| 513 |
|
| 514 |
!! test |
| 515 |
Definition Lists: Nesting: Multi-level (Parsoid only) |
| 516 |
!! wikitext |
| 517 |
;t1:d1 |
| 518 |
;;t2::d2 |
| 519 |
;;;t3:::d3 |
| 520 |
!! html/parsoid |
| 521 |
<dl> |
| 522 |
<dt>t1 </dt> |
| 523 |
<dd>d1</dd> |
| 524 |
<dt> |
| 525 |
<dl> |
| 526 |
<dt>t2 </dt> |
| 527 |
<dd>:d2</dd> |
| 528 |
<dt> |
| 529 |
<dl> |
| 530 |
<dt>t3 </dt> |
| 531 |
<dd>::d3</dd> |
| 532 |
</dl> |
| 533 |
</dt> |
| 534 |
</dl> |
| 535 |
</dt> |
| 536 |
</dl> |
| 537 |
!! end |
| 538 |
|
| 539 |
|
| 540 |
!! test |
| 541 |
Definition Lists: Nesting: Test 2 |
| 542 |
!! wikitext |
| 543 |
;t1 |
| 544 |
::d2 |
| 545 |
!! html |
| 546 |
<dl><dt>t1</dt> |
| 547 |
<dd> |
| 548 |
<dl><dd>d2</dd></dl></dd></dl> |
| 549 |
!! end |
| 550 |
|
| 551 |
|
| 552 |
!! test |
| 553 |
Definition Lists: Nesting: Test 3 |
| 554 |
!! wikitext |
| 555 |
:;t1 |
| 556 |
::::d2 |
| 557 |
!! html |
| 558 |
<dl><dd><dl><dt>t1</dt> |
| 559 |
<dd> |
| 560 |
<dl><dd><dl><dd>d2</dd></dl></dd></dl></dd></dl></dd></dl> |
| 561 |
!! end |
| 562 |
|
| 563 |
|
| 564 |
!! test |
| 565 |
Definition Lists: Nesting: Test 4 |
| 566 |
!! wikitext |
| 567 |
::;t3 |
| 568 |
:::d3 |
| 569 |
!! html |
| 570 |
<dl><dd><dl><dd><dl><dt>t3</dt> |
| 571 |
<dd>d3</dd></dl></dd></dl></dd></dl> |
| 572 |
!! end |
| 573 |
|
| 574 |
|
| 575 |
## The Parsoid team believes the following three test exposes a |
| 576 |
## bug in the PHP parser. (Parsoid team thinks the PHP parser is |
| 577 |
## wrong to close the <dl> after the <dt> containing the <ul>.) |
| 578 |
## It also exposes a "misfeature" in tidy, which doesn't like |
| 579 |
## <dl> tags with a single <dt> child; it converts the <dt> into |
| 580 |
## a <dd> in that case. (Parsoid leaves the <dt> alone!) |
| 581 |
!! test |
| 582 |
Definition Lists: Mixed Lists: Test 1 |
| 583 |
!! wikitext |
| 584 |
:;*foo |
| 585 |
::*bar |
| 586 |
:;baz |
| 587 |
!! html/php |
| 588 |
<dl><dd><dl><dt><ul><li>foo</li> |
| 589 |
<li>bar</li></ul></dt></dl> |
| 590 |
<dl><dt>baz</dt></dl></dd></dl> |
| 591 |
!! html/php |
| 592 |
<dl><dd><dl><dt><ul><li>foo</li> |
| 593 |
<li>bar</li></ul></dt></dl> |
| 594 |
<dl><dt>baz</dt></dl></dd></dl> |
| 595 |
!! html/parsoid |
| 596 |
<dl> |
| 597 |
<dd><dl> |
| 598 |
<dt><ul> |
| 599 |
<li>foo |
| 600 |
</li> |
| 601 |
</ul></dt> |
| 602 |
<dd><ul> |
| 603 |
<li>bar |
| 604 |
</li> |
| 605 |
</ul></dd> |
| 606 |
<dt>baz</dt> |
| 607 |
</dl></dd> |
| 608 |
</dl> |
| 609 |
!! end |
| 610 |
|
| 611 |
!! test |
| 612 |
Definition Lists: Mixed Lists: Test 2 |
| 613 |
!! wikitext |
| 614 |
*:d1 |
| 615 |
*:d2 |
| 616 |
!! html |
| 617 |
<ul><li><dl><dd>d1</dd> |
| 618 |
<dd>d2</dd></dl></li></ul> |
| 619 |
!! end |
| 620 |
|
| 621 |
|
| 622 |
!! test |
| 623 |
Definition Lists: Mixed Lists: Test 3 |
| 624 |
!! wikitext |
| 625 |
*:::d1 |
| 626 |
*:::d2 |
| 627 |
!! html |
| 628 |
<ul><li><dl><dd><dl><dd><dl><dd>d1</dd> |
| 629 |
<dd>d2</dd></dl></dd></dl></dd></dl></li></ul> |
| 630 |
!! end |
| 631 |
|
| 632 |
|
| 633 |
!! test |
| 634 |
Definition Lists: Mixed Lists: Test 4 |
| 635 |
!! options |
| 636 |
parsoid=wt2html,html2html |
| 637 |
!! wikitext |
| 638 |
*;d1 :d2 |
| 639 |
*;d3 :d4 |
| 640 |
!! html |
| 641 |
<ul><li><dl><dt>d1</dt> |
| 642 |
<dd>d2</dd> |
| 643 |
<dt>d3</dt> |
| 644 |
<dd>d4</dd></dl></li></ul> |
| 645 |
!! end |
| 646 |
|
| 647 |
|
| 648 |
!! test |
| 649 |
Definition Lists: Mixed Lists: Test 5 |
| 650 |
!! wikitext |
| 651 |
*:d1 |
| 652 |
*::d2 |
| 653 |
!! html |
| 654 |
<ul><li><dl><dd>d1 |
| 655 |
<dl><dd>d2</dd></dl></dd></dl></li></ul> |
| 656 |
!! end |
| 657 |
|
| 658 |
|
| 659 |
!! test |
| 660 |
Definition Lists: Mixed Lists: Test 6 |
| 661 |
!! wikitext |
| 662 |
#*:d1 |
| 663 |
#*:::d3 |
| 664 |
!! html |
| 665 |
<ol><li><ul><li><dl><dd>d1 |
| 666 |
<dl><dd><dl><dd>d3</dd></dl></dd></dl></dd></dl></li></ul></li></ol> |
| 667 |
!! end |
| 668 |
|
| 669 |
|
| 670 |
!! test |
| 671 |
Definition Lists: Mixed Lists: Test 7 |
| 672 |
!! wikitext |
| 673 |
:*d1 |
| 674 |
:*d2 |
| 675 |
!! html |
| 676 |
<dl><dd><ul><li>d1</li> |
| 677 |
<li>d2</li></ul></dd></dl> |
| 678 |
!! end |
| 679 |
|
| 680 |
|
| 681 |
!! test |
| 682 |
Definition Lists: Mixed Lists: Test 8 |
| 683 |
!! wikitext |
| 684 |
:*d1 |
| 685 |
::*d2 |
| 686 |
!! html |
| 687 |
<dl><dd><ul><li>d1</li></ul> |
| 688 |
<dl><dd><ul><li>d2</li></ul></dd></dl></dd></dl> |
| 689 |
!! end |
| 690 |
|
| 691 |
|
| 692 |
!! test |
| 693 |
Definition Lists: Mixed Lists: Test 9 |
| 694 |
!! options |
| 695 |
parsoid=wt2html,html2html |
| 696 |
!! wikitext |
| 697 |
*;foo :bar |
| 698 |
!! html |
| 699 |
<ul><li><dl><dt>foo</dt> |
| 700 |
<dd>bar</dd></dl></li></ul> |
| 701 |
!! end |
| 702 |
|
| 703 |
|
| 704 |
!! test |
| 705 |
Definition Lists: Mixed Lists: Test 10 |
| 706 |
!! options |
| 707 |
parsoid=wt2html,html2html |
| 708 |
!! wikitext |
| 709 |
*#;foo :bar |
| 710 |
!! html |
| 711 |
<ul><li><ol><li><dl><dt>foo</dt> |
| 712 |
<dd>bar</dd></dl></li></ol></li></ul> |
| 713 |
!! end |
| 714 |
|
| 715 |
# The Parsoid team disagrees with the PHP parser's seemingly-random |
| 716 |
# rules regarding dd/dt on the next few tests. Parsoid is more |
| 717 |
# consistent, and recognizes the shared nesting and keeps the |
| 718 |
# still-open tags around until the nesting is complete. |
| 719 |
|
| 720 |
# This is a regression test for T175099 |
| 721 |
!! test |
| 722 |
Definition Lists: Mixed Lists: Test 11 |
| 723 |
!! wikitext |
| 724 |
;a |
| 725 |
:*b |
| 726 |
!! html/php |
| 727 |
<dl><dt>a</dt> |
| 728 |
<dd> |
| 729 |
<ul><li>b</li></ul></dd></dl> |
| 730 |
!! html/parsoid |
| 731 |
<dl><dt>a |
| 732 |
<dd><ul><li>b</li></ul></dd></dl> |
| 733 |
!! end |
| 734 |
|
| 735 |
# FIXME: Maybe get rid of this test? |
| 736 |
!! test |
| 737 |
Definition Lists: Mixed Lists: Test 12 |
| 738 |
!! options |
| 739 |
parsoid=wt2html,html2html |
| 740 |
!! wikitext |
| 741 |
*#*#;*;;foo :bar |
| 742 |
*#*#;boo :baz |
| 743 |
!! html/php |
| 744 |
<ul><li><ol><li><ul><li><ol><li><dl><dt>foo</dt> |
| 745 |
<dd><ul><li><dl><dt><dl><dt>bar</dt></dl></dt></dl></li></ul></dd></dl></li></ol></li></ul> |
| 746 |
<dl><dt>boo</dt> |
| 747 |
<dd>baz</dd></dl></li></ol></li></ul> |
| 748 |
!! html/parsoid |
| 749 |
<ul> |
| 750 |
<li> |
| 751 |
<ol> |
| 752 |
<li> |
| 753 |
<ul> |
| 754 |
<li> |
| 755 |
<ol> |
| 756 |
<li> |
| 757 |
<dl> |
| 758 |
<dt> |
| 759 |
<ul> |
| 760 |
<li> |
| 761 |
<dl> |
| 762 |
<dt> |
| 763 |
<dl> |
| 764 |
<dt>foo</dt> |
| 765 |
<dd data-parsoid='{"stx":"row"}'>bar</dd> |
| 766 |
</dl></dt> |
| 767 |
</dl></li> |
| 768 |
</ul></dt> |
| 769 |
<dt>boo</dt> |
| 770 |
<dd data-parsoid='{"stx":"row"}'>baz</dd> |
| 771 |
</dl></li> |
| 772 |
</ol></li> |
| 773 |
</ul></li> |
| 774 |
</ol></li> |
| 775 |
</ul> |
| 776 |
!! end |
| 777 |
|
| 778 |
!! test |
| 779 |
Definition Lists: Mixed Lists: Test 13 |
| 780 |
!! options |
| 781 |
parsoid=wt2html,html2html |
| 782 |
!! wikitext |
| 783 |
*#*#;*;;foo : bar |
| 784 |
*#*#;boo : baz |
| 785 |
!! html |
| 786 |
<ul><li><ol><li><ul><li><ol><li><dl><dt>foo</dt> |
| 787 |
<dd><ul><li><dl><dt><dl><dt>bar</dt></dl></dt></dl></li></ul></dd></dl></li></ol></li></ul> |
| 788 |
<dl><dt>boo</dt> |
| 789 |
<dd>baz</dd></dl></li></ol></li></ul> |
| 790 |
!! end |
| 791 |
|
| 792 |
# FIXME: Maybe get rid of this test? |
| 793 |
# From an old description in the Parsoid codebase: |
| 794 |
# * The test is wrong, there are two colons where there should be :; |
| 795 |
# * The PHP parser is wrong to close the <dl> after the <dt> containing the <ul>. |
| 796 |
!! test |
| 797 |
Definition Lists: Weird Ones: Test 1 |
| 798 |
!! options |
| 799 |
parsoid=wt2html,html2html |
| 800 |
!! wikitext |
| 801 |
*#;*::;;foo :bar (who uses this?) |
| 802 |
!! html/php |
| 803 |
<ul><li><ol><li><dl><dt>foo</dt> |
| 804 |
<dd><ul><li><dl><dd><dl><dd><dl><dt><dl><dt>bar (who uses this?)</dt></dl></dt></dl></dd></dl></dd></dl></li></ul></dd></dl></li></ol></li></ul> |
| 805 |
!! html/parsoid |
| 806 |
<ul> |
| 807 |
<li> |
| 808 |
<ol> |
| 809 |
<li> |
| 810 |
<dl> |
| 811 |
<dt> |
| 812 |
<ul> |
| 813 |
<li> |
| 814 |
<dl> |
| 815 |
<dd> |
| 816 |
<dl> |
| 817 |
<dd> |
| 818 |
<dl> |
| 819 |
<dt> |
| 820 |
<dl> |
| 821 |
<dt>foo</dt> |
| 822 |
<dd data-parsoid='{"stx":"row"}'>bar (who uses this?)</dd> |
| 823 |
</dl></dt> |
| 824 |
</dl></dd> |
| 825 |
</dl></dd> |
| 826 |
</dl></li> |
| 827 |
</ul></dt> |
| 828 |
</dl></li> |
| 829 |
</ol></li> |
| 830 |
</ul> |
| 831 |
!! end |
| 832 |
|
| 833 |
!! test |
| 834 |
Definition Lists: colons occurring in tags |
| 835 |
!! wikitext |
| 836 |
;a:b |
| 837 |
;'''a:b''' |
| 838 |
;<i>a:b</i> |
| 839 |
;<span>a:b</span> |
| 840 |
;<div>a:b</div> |
| 841 |
;<div>a |
| 842 |
:b</div> |
| 843 |
;{{1x|a:b}} |
| 844 |
;{{1x|''a:b''}} |
| 845 |
;;;''a:b'' |
| 846 |
!! html/php |
| 847 |
<dl><dt>a</dt> |
| 848 |
<dd>b</dd> |
| 849 |
<dt><b>a:b</b></dt> |
| 850 |
<dt><i>a:b</i></dt> |
| 851 |
<dt><span>a:b</span></dt> |
| 852 |
<dt><div>a:b</div></dt> |
| 853 |
<dt><div>a</div></dt> |
| 854 |
<dd>b</dd> |
| 855 |
<dt>a</dt> |
| 856 |
<dd>b</dd> |
| 857 |
<dt><i>a:b</i></dt></dl> |
| 858 |
<dl><dt><dl><dt><dl><dt><i>a:b</i></dt></dl></dt></dl></dt></dl> |
| 859 |
!! html/parsoid |
| 860 |
<dl><dt>a</dt><dd data-parsoid='{"stx":"row"}'>b</dd> |
| 861 |
<dt><b>a:b</b></dt> |
| 862 |
<dt><i data-parsoid='{"stx":"html"}'>a:b</i></dt> |
| 863 |
<dt><span data-parsoid='{"stx":"html"}'>a:b</span></dt> |
| 864 |
<dt><div data-parsoid='{"stx":"html"}'>a:b</div></dt> |
| 865 |
<dt><div data-parsoid='{"stx":"html","autoInsertedEnd":true}'>a</div></dt> |
| 866 |
<dd>b<meta typeof="mw:Placeholder/StrippedTag" data-parsoid='{"src":"</div>","name":"div"}'/></dd> |
| 867 |
<dt><span about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"a:b"}},"i":0}}]}'>a:b</span></dt> |
| 868 |
<dt><i about="#mwt2" typeof="mw:Transclusion" data-parsoid='{"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"1x","href":"./Template:1x"},"params":{"1":{"wt":"''a:b''"}},"i":0}}]}'>a:b</i> |
| 869 |
<dl><dt><dl><dt><i>a:b</i></dt></dl></dt></dl></dt></dl> |
| 870 |
!! end |
| 871 |
|
| 872 |
# Parsoid's output differs here again because it shares |
| 873 |
# nesting between the two lists unlike the PHP parser. |
| 874 |
# Unsure which is more desirable. |
| 875 |
!! test |
| 876 |
Definition Lists: colons and tables 1 |
| 877 |
!! wikitext |
| 878 |
:{| |
| 879 |
|x |
| 880 |
|} |
| 881 |
:{| |
| 882 |
|y |
| 883 |
|} |
| 884 |
!! html/php |
| 885 |
<dl><dd><table> |
| 886 |
<tbody><tr> |
| 887 |
<td>x |
| 888 |
</td></tr></tbody></table></dd></dl> |
| 889 |
<dl><dd><table> |
| 890 |
<tbody><tr> |
| 891 |
<td>y |
| 892 |
</td></tr></tbody></table></dd></dl> |
| 893 |
!! html/parsoid |
| 894 |
<dl><dd><table> |
| 895 |
<tr> |
| 896 |
<td>x |
| 897 |
</td></tr></table></dd> |
| 898 |
<dd><table> |
| 899 |
<tr> |
| 900 |
<td>y |
| 901 |
</td></tr></table></dd></dl> |
| 902 |
!! end |
| 903 |
|
| 904 |
# FIXME: Does this need a html/php section? |
| 905 |
!! test |
| 906 |
Definition Lists: template interaction |
| 907 |
!! wikitext |
| 908 |
::{{definition_list}} |
| 909 |
|
| 910 |
:one |
| 911 |
::{{definition_list}} |
| 912 |
:::two |
| 913 |
:::three |
| 914 |
::four |
| 915 |
!! html/parsoid |
| 916 |
<dl><dd><dl data-parsoid='{}'><dd about="#mwt1" typeof="mw:Transclusion" data-mw='{"parts":[":",{"template":{"target":{"wt":"definition_list","href":"./Template:Definition_list"},"params":{},"i":0}}]}'>one</dd><span about="#mwt1"> |
| 917 |
</span><dd about="#mwt1">two</dd></dl></dd></dl> |
| 918 |
|
| 919 |
<dl><dd data-parsoid='{}'>one |
| 920 |
<dl><dd about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":["::",{"template":{"target":{"wt":"definition_list","href":"./Template:Definition_list"},"params":{},"i":0}},"\n:::two\n:::three"]}'>one</dd><span about="#mwt2"> |
| 921 |
</span><dd about="#mwt2">two |
| 922 |
<dl><dd>two</dd> |
| 923 |
<dd>three</dd></dl></dd> |
| 924 |
<dd data-parsoid='{}'>four</dd></dl></dd></dl> |
| 925 |
!! end |