Index: trunk/phase3/tests/parser/parserTests.txt |
— | — | @@ -1255,12 +1255,16 @@ |
1256 | 1256 | !! result |
1257 | 1257 | <table> |
1258 | 1258 | <tr> |
1259 | | -<td>1</td> |
1260 | | -<td>2</td> |
| 1259 | +<td>1 |
| 1260 | +</td> |
| 1261 | +<td>2 |
| 1262 | +</td> |
1261 | 1263 | </tr> |
1262 | 1264 | <tr> |
1263 | | -<td>3</td> |
1264 | | -<td>4</td> |
| 1265 | +<td>3 |
| 1266 | +</td> |
| 1267 | +<td>4 |
| 1268 | +</td> |
1265 | 1269 | </tr> |
1266 | 1270 | </table> |
1267 | 1271 | |
— | — | @@ -1295,41 +1299,65 @@ |
1296 | 1300 | </caption> |
1297 | 1301 | <thead> |
1298 | 1302 | <tr> |
1299 | | -<th>×</th> |
1300 | | -<th>1</th> |
1301 | | -<th>2</th> |
1302 | | -<th>3</th> |
| 1303 | +<th>× |
| 1304 | +</th> |
| 1305 | +<th>1 |
| 1306 | +</th> |
| 1307 | +<th>2 |
| 1308 | +</th> |
| 1309 | +<th>3 |
| 1310 | +</th> |
1303 | 1311 | </tr></thead> |
1304 | 1312 | <tbody> |
1305 | 1313 | <tr> |
1306 | | -<th>1</th> |
1307 | | -<td>1</td> |
1308 | | -<td>2</td> |
1309 | | -<td>3</td> |
| 1314 | +<th>1 |
| 1315 | +</th> |
| 1316 | +<td>1 |
| 1317 | +</td> |
| 1318 | +<td>2 |
| 1319 | +</td> |
| 1320 | +<td>3 |
| 1321 | +</td> |
1310 | 1322 | </tr> |
1311 | 1323 | <tr> |
1312 | | -<th>2</th> |
1313 | | -<td>2</td> |
1314 | | -<td>4</td> |
1315 | | -<td>6</td> |
| 1324 | +<th>2 |
| 1325 | +</th> |
| 1326 | +<td>2 |
| 1327 | +</td> |
| 1328 | +<td>4 |
| 1329 | +</td> |
| 1330 | +<td>6 |
| 1331 | +</td> |
1316 | 1332 | </tr> |
1317 | 1333 | <tr> |
1318 | | -<th>3</th> |
1319 | | -<td>3</td> |
1320 | | -<td>6</td> |
1321 | | -<td>9</td> |
| 1334 | +<th>3 |
| 1335 | +</th> |
| 1336 | +<td>3 |
| 1337 | +</td> |
| 1338 | +<td>6 |
| 1339 | +</td> |
| 1340 | +<td>9 |
| 1341 | +</td> |
1322 | 1342 | </tr> |
1323 | 1343 | <tr> |
1324 | | -<th>4</th> |
1325 | | -<td>4</td> |
1326 | | -<td>8</td> |
1327 | | -<td>12</td> |
| 1344 | +<th>4 |
| 1345 | +</th> |
| 1346 | +<td>4 |
| 1347 | +</td> |
| 1348 | +<td>8 |
| 1349 | +</td> |
| 1350 | +<td>12 |
| 1351 | +</td> |
1328 | 1352 | </tr> |
1329 | 1353 | <tr> |
1330 | | -<th>5</th> |
1331 | | -<td>5</td> |
1332 | | -<td>10</td> |
1333 | | -<td>15</td> |
| 1354 | +<th>5 |
| 1355 | +</th> |
| 1356 | +<td>5 |
| 1357 | +</td> |
| 1358 | +<td>10 |
| 1359 | +</td> |
| 1360 | +<td>15 |
| 1361 | +</td> |
1334 | 1362 | </tr></tbody> |
1335 | 1363 | </table> |
1336 | 1364 | |
— | — | @@ -1349,13 +1377,18 @@ |
1350 | 1378 | !! result |
1351 | 1379 | <table align="right" border="1"> |
1352 | 1380 | <tr> |
1353 | | -<td>Cell 1, row 1</td> |
1354 | | -<td rowspan="2">Cell 2, row 1 (and 2)</td> |
1355 | | -<td>Cell 3, row 1</td> |
| 1381 | +<td>Cell 1, row 1 |
| 1382 | +</td> |
| 1383 | +<td rowspan="2">Cell 2, row 1 (and 2) |
| 1384 | +</td> |
| 1385 | +<td>Cell 3, row 1 |
| 1386 | +</td> |
1356 | 1387 | </tr> |
1357 | 1388 | <tr> |
1358 | | -<td>Cell 1, row 2</td> |
1359 | | -<td>Cell 3, row 2</td> |
| 1389 | +<td>Cell 1, row 2 |
| 1390 | +</td> |
| 1391 | +<td>Cell 3, row 2 |
| 1392 | +</td> |
1360 | 1393 | </tr> |
1361 | 1394 | </table> |
1362 | 1395 | |
— | — | @@ -1377,17 +1410,22 @@ |
1378 | 1411 | !! result |
1379 | 1412 | <table border="1"> |
1380 | 1413 | <tr> |
1381 | | -<td>α</td> |
| 1414 | +<td>α |
| 1415 | +</td> |
1382 | 1416 | <td> |
1383 | 1417 | <table bgcolor="#ABCDEF" border="2"> |
1384 | 1418 | <tr> |
1385 | | -<td>nested</td> |
| 1419 | +<td>nested |
| 1420 | +</td> |
1386 | 1421 | </tr> |
1387 | 1422 | <tr> |
1388 | | -<td>table</td> |
| 1423 | +<td>table |
| 1424 | +</td> |
1389 | 1425 | </tr> |
1390 | | -</table></td> |
1391 | | -<td>the original table again</td> |
| 1426 | +</table> |
| 1427 | +</td> |
| 1428 | +<td>the original table again |
| 1429 | +</td> |
1392 | 1430 | </tr> |
1393 | 1431 | </table> |
1394 | 1432 | |
— | — | @@ -1402,7 +1440,8 @@ |
1403 | 1441 | !! result |
1404 | 1442 | <table> |
1405 | 1443 | <tr> |
1406 | | -<td>broken</td> |
| 1444 | +<td>broken |
| 1445 | +</td> |
1407 | 1446 | </tr> |
1408 | 1447 | </table> |
1409 | 1448 | |
— | — | @@ -1439,7 +1478,8 @@ |
1440 | 1479 | <caption><i>caption</i> |
1441 | 1480 | </caption> |
1442 | 1481 | <tr> |
1443 | | -<td>Cell</td> |
| 1482 | +<td>Cell |
| 1483 | +</td> |
1444 | 1484 | </tr> |
1445 | 1485 | </table> |
1446 | 1486 | |
— | — | @@ -1454,7 +1494,8 @@ |
1455 | 1495 | !! result |
1456 | 1496 | <table> |
1457 | 1497 | <tr> |
1458 | | -<td><i>Cell</i></td> |
| 1498 | +<td><i>Cell</i> |
| 1499 | +</td> |
1459 | 1500 | </tr> |
1460 | 1501 | </table> |
1461 | 1502 | |
— | — | @@ -1471,8 +1512,10 @@ |
1472 | 1513 | !! result |
1473 | 1514 | <table> |
1474 | 1515 | <tr> |
1475 | | -<th><i>Cell</i></th> |
1476 | | -<td>Value</td> |
| 1516 | +<th><i>Cell</i> |
| 1517 | +</th> |
| 1518 | +<td>Value |
| 1519 | +</td> |
1477 | 1520 | </tr> |
1478 | 1521 | </table> |
1479 | 1522 | |
— | — | @@ -1486,8 +1529,10 @@ |
1487 | 1530 | !! result |
1488 | 1531 | <table> |
1489 | 1532 | <tr> |
1490 | | -<td>[<a rel="nofollow" class="external free" href="ftp://%7Cx">ftp://%7Cx</a></td> |
1491 | | -<td>]" onmouseover="alert(document.cookie)">test</td> |
| 1533 | +<td>[<a rel="nofollow" class="external free" href="ftp://%7Cx">ftp://%7Cx</a> |
| 1534 | +</td> |
| 1535 | +<td>]" onmouseover="alert(document.cookie)">test |
| 1536 | +</td> |
1492 | 1537 | </tr> |
1493 | 1538 | </table> |
1494 | 1539 | |
— | — | @@ -1504,12 +1549,16 @@ |
1505 | 1550 | !! result |
1506 | 1551 | <dl><dd><table> |
1507 | 1552 | <tr> |
1508 | | -<td>1</td> |
1509 | | -<td>2</td> |
| 1553 | +<td>1 |
| 1554 | +</td> |
| 1555 | +<td>2 |
| 1556 | +</td> |
1510 | 1557 | </tr> |
1511 | 1558 | <tr> |
1512 | | -<td>3</td> |
1513 | | -<td>4</td> |
| 1559 | +<td>3 |
| 1560 | +</td> |
| 1561 | +<td>4 |
| 1562 | +</td> |
1514 | 1563 | </tr> |
1515 | 1564 | </table></dd></dl> |
1516 | 1565 | |
— | — | @@ -2773,7 +2822,8 @@ |
2774 | 2823 | !! result |
2775 | 2824 | <table> |
2776 | 2825 | <tr> |
2777 | | -<td>[[{{{1}}}|{{{2}}}]]</td> |
| 2826 | +<td>[[{{{1}}}|{{{2}}}]] |
| 2827 | +</td> |
2778 | 2828 | </tr> |
2779 | 2829 | </table> |
2780 | 2830 | |
— | — | @@ -2884,12 +2934,16 @@ |
2885 | 2935 | </p> |
2886 | 2936 | <table> |
2887 | 2937 | <tr> |
2888 | | -<td>1</td> |
2889 | | -<td>2</td> |
| 2938 | +<td>1 |
| 2939 | +</td> |
| 2940 | +<td>2 |
| 2941 | +</td> |
2890 | 2942 | </tr> |
2891 | 2943 | <tr> |
2892 | | -<td>3</td> |
2893 | | -<td>4</td> |
| 2944 | +<td>3 |
| 2945 | +</td> |
| 2946 | +<td>4 |
| 2947 | +</td> |
2894 | 2948 | </tr> |
2895 | 2949 | </table> |
2896 | 2950 | |
— | — | @@ -2905,12 +2959,16 @@ |
2906 | 2960 | </p> |
2907 | 2961 | <table> |
2908 | 2962 | <tr> |
2909 | | -<td>1</td> |
2910 | | -<td>2</td> |
| 2963 | +<td>1 |
| 2964 | +</td> |
| 2965 | +<td>2 |
| 2966 | +</td> |
2911 | 2967 | </tr> |
2912 | 2968 | <tr> |
2913 | | -<td>3</td> |
2914 | | -<td>4</td> |
| 2969 | +<td>3 |
| 2970 | +</td> |
| 2971 | +<td>4 |
| 2972 | +</td> |
2915 | 2973 | </tr> |
2916 | 2974 | </table> |
2917 | 2975 | |
— | — | @@ -4461,7 +4519,8 @@ |
4462 | 4520 | !! result |
4463 | 4521 | <table> |
4464 | 4522 | <tr> |
4465 | | -<th class="awesome">status</th> |
| 4523 | +<th class="awesome">status |
| 4524 | +</th> |
4466 | 4525 | </tr> |
4467 | 4526 | </table> |
4468 | 4527 | |
— | — | @@ -4907,7 +4966,8 @@ |
4908 | 4967 | !! result |
4909 | 4968 | <table> |
4910 | 4969 | <tr> |
4911 | | -<th style="color:blue">status</th> |
| 4970 | +<th style="color:blue">status |
| 4971 | +</th> |
4912 | 4972 | </tr> |
4913 | 4973 | </table> |
4914 | 4974 | |
— | — | @@ -4922,7 +4982,8 @@ |
4923 | 4983 | !! result |
4924 | 4984 | <table> |
4925 | 4985 | <tr> |
4926 | | -<th style="/* insecure input */">status</th> |
| 4986 | +<th style="/* insecure input */">status |
| 4987 | +</th> |
4927 | 4988 | </tr> |
4928 | 4989 | </table> |
4929 | 4990 | |
— | — | @@ -5577,7 +5638,8 @@ |
5578 | 5639 | <h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&action=edit&section=1" title="Edit section: a">edit</a>]</span> <span class="mw-headline" id="a">a</span></h2> |
5579 | 5640 | <table style="__TOC__"> |
5580 | 5641 | <tr> |
5581 | | -<td>foo</td> |
| 5642 | +<td>foo |
| 5643 | +</td> |
5582 | 5644 | </tr> |
5583 | 5645 | </table> |
5584 | 5646 | |
— | — | @@ -5594,7 +5656,8 @@ |
5595 | 5657 | !! result |
5596 | 5658 | <table> |
5597 | 5659 | <tr> |
5598 | | -<th>https://</th> |
| 5660 | +<th>https:// |
| 5661 | +</th> |
5599 | 5662 | <th></th> |
5600 | 5663 | <th></th> |
5601 | 5664 | <th></th> |
— | — | @@ -5612,7 +5675,8 @@ |
5613 | 5676 | !! result |
5614 | 5677 | <table> |
5615 | 5678 | <tr> |
5616 | | -<th><a rel="nofollow" class="external free" href="irc://{{ftp://a">irc://{{ftp://a</a>" onmouseover="alert('hello world');"</th> |
| 5679 | +<th><a rel="nofollow" class="external free" href="irc://{{ftp://a">irc://{{ftp://a</a>" onmouseover="alert('hello world');" |
| 5680 | +</th> |
5617 | 5681 | <td></td> |
5618 | 5682 | </tr> |
5619 | 5683 | </table> |
— | — | @@ -5672,7 +5736,8 @@ |
5673 | 5737 | </p> |
5674 | 5738 | <table> |
5675 | 5739 | <tr> |
5676 | | -<td></u></td> |
| 5740 | +<td></u> |
| 5741 | +</td> |
5677 | 5742 | </tr> |
5678 | 5743 | </table> |
5679 | 5744 | |
— | — | @@ -7843,12 +7908,16 @@ |
7844 | 7909 | </p> |
7845 | 7910 | <table> |
7846 | 7911 | <tr> |
7847 | | -<td>1</td> |
7848 | | -<td>2</td> |
| 7912 | +<td>1 |
| 7913 | +</td> |
| 7914 | +<td>2 |
| 7915 | +</td> |
7849 | 7916 | </tr> |
7850 | 7917 | <tr> |
7851 | | -<td>3</td> |
7852 | | -<td>4</td> |
| 7918 | +<td>3 |
| 7919 | +</td> |
| 7920 | +<td>4 |
| 7921 | +</td> |
7853 | 7922 | </tr></table> |
7854 | 7923 | <p>y |
7855 | 7924 | </p> |
Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -1067,6 +1067,8 @@ |
1068 | 1068 | $return .= '>'; |
1069 | 1069 | |
1070 | 1070 | $return .= $table[$i][$j]['content']; |
| 1071 | + if ( $table[$i][$j]['content'] != '' ) |
| 1072 | + $return .= "\n"; |
1071 | 1073 | |
1072 | 1074 | $return .= '</' . $table[$i][$j]['type'] . '>'; |
1073 | 1075 | unset( $table[$i][$j] ); |