Index: trunk/phase3/tests/parser/parserTests.txt |
— | — | @@ -1435,6 +1435,37 @@ |
1436 | 1436 | |
1437 | 1437 | !! end |
1438 | 1438 | !! test |
| 1439 | +Table with broken up list inside |
| 1440 | +!! input |
| 1441 | +{| |
| 1442 | +|style="width: 5em; text-align: center"| gives |
| 1443 | +|style="border: 1px dashed #2F6FAB; padding: 0.5em; margin: 0.5em"| |
| 1444 | +# Some |
| 1445 | +# list |
| 1446 | +# Lorem |
| 1447 | + |
| 1448 | +# ipsum |
| 1449 | +# dolor |
| 1450 | +|} |
| 1451 | +!! result |
| 1452 | +<table> |
| 1453 | +<tr> |
| 1454 | +<td style="width: 5em; text-align: center">gives |
| 1455 | +</td> |
| 1456 | +<td style="border: 1px dashed #2F6FAB; padding: 0.5em; margin: 0.5em"> |
| 1457 | +<ol><li> Some |
| 1458 | +</li><li> list |
| 1459 | +</li><li> Lorem |
| 1460 | +</li></ol> |
| 1461 | +<ol><li> ipsum |
| 1462 | +</li><li> dolor |
| 1463 | +</li></ol> |
| 1464 | +</td> |
| 1465 | +</tr> |
| 1466 | +</table> |
| 1467 | + |
| 1468 | +!! end |
| 1469 | +!! test |
1439 | 1470 | Simple paragraph |
1440 | 1471 | !! input |
1441 | 1472 | This is a simple paragraph. |
— | — | @@ -1780,6 +1811,8 @@ |
1781 | 1812 | <td>1 |
1782 | 1813 | </td> |
1783 | 1814 | <td>2 |
| 1815 | +<p><br /> |
| 1816 | +</p> |
1784 | 1817 | </td> |
1785 | 1818 | </tr> |
1786 | 1819 | <tr> |
— | — | @@ -3374,7 +3407,36 @@ |
3375 | 3408 | !! result |
3376 | 3409 | ==Section 1== |
3377 | 3410 | !! end |
| 3411 | +!! article |
| 3412 | +Template:Top-level template |
| 3413 | +!! text |
| 3414 | +{{Nested template}} |
| 3415 | +!! endarticle |
3378 | 3416 | |
| 3417 | +!! article |
| 3418 | +Template:Nested template |
| 3419 | +!! text |
| 3420 | +*Item 1 |
| 3421 | +*Item 2 |
| 3422 | +!! endarticle |
| 3423 | + |
| 3424 | +!! test |
| 3425 | +Line-start flag in a nested template call |
| 3426 | +!! input |
| 3427 | +*Item A |
| 3428 | +*Item B |
| 3429 | + |
| 3430 | +{{Top-level template}} |
| 3431 | +!! result |
| 3432 | +<ul><li>Item A |
| 3433 | +</li><li>Item B |
| 3434 | +</li></ul> |
| 3435 | +<ul><li>Item 1 |
| 3436 | +</li><li>Item 2 |
| 3437 | +</li></ul> |
| 3438 | + |
| 3439 | +!! end |
| 3440 | + |
3379 | 3441 | ### |
3380 | 3442 | ### Pre-save transform tests |
3381 | 3443 | ### |
— | — | @@ -5928,6 +5990,7 @@ |
5929 | 5991 | |
5930 | 5992 | !!result |
5931 | 5993 | <p><a rel="nofollow" class="external free" href="http://===r:::https://b">http://===r:::https://b</a> |
| 5994 | +</p><p><br /> |
5932 | 5995 | </p> |
5933 | 5996 | !! end |
5934 | 5997 | |
— | — | @@ -5966,7 +6029,7 @@ |
5967 | 6030 | <p>{{{| |
5968 | 6031 | <u class="|">}}}} > |
5969 | 6032 | <br style="onmouseover='alert(document.cookie);'" /> |
5970 | | -MOVE YOUR MOUSE CURSOR OVER THIS TEXT |
| 6033 | +</p><p>MOVE YOUR MOUSE CURSOR OVER THIS TEXT |
5971 | 6034 | </p> |
5972 | 6035 | <table> |
5973 | 6036 | <tr> |
Index: trunk/phase3/includes/parser/Preprocessor_DOM.php |
— | — | @@ -521,7 +521,7 @@ |
522 | 522 | 'open' => $curChar, |
523 | 523 | 'close' => $rule['end'], |
524 | 524 | 'count' => $count, |
525 | | - 'lineStart' => ($i > 0 && $text[$i-1] == "\n"), |
| 525 | + 'lineStart' => ($i == 0 || $text[$i-1] == "\n"), |
526 | 526 | ); |
527 | 527 | |
528 | 528 | $stack->push( $piece ); |
Index: trunk/phase3/includes/parser/Preprocessor_Hash.php |
— | — | @@ -493,7 +493,7 @@ |
494 | 494 | 'open' => $curChar, |
495 | 495 | 'close' => $rule['end'], |
496 | 496 | 'count' => $count, |
497 | | - 'lineStart' => ($i > 0 && $text[$i-1] == "\n"), |
| 497 | + 'lineStart' => ($i == 0 || $text[$i-1] == "\n"), |
498 | 498 | ); |
499 | 499 | |
500 | 500 | $stack->push( $piece ); |
Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -831,11 +831,8 @@ |
832 | 832 | |
833 | 833 | # empty line, go to next line, |
834 | 834 | # but only append \n if outside of table |
835 | | - if ( $line === '' ) { |
836 | | - $out .= $outLine; |
837 | | - if ( !isset( $tables[0] ) ) { |
838 | | - $out .= "\n"; |
839 | | - } |
| 835 | + if ( $line === '') { |
| 836 | + $output .= $outLine . "\n"; |
840 | 837 | continue; |
841 | 838 | } |
842 | 839 | $firstChars = $line[0]; |