From 0677784244faee633b5660def96c7e86447e971a Mon Sep 17 00:00:00 2001 From: Platonides Date: Wed, 13 Apr 2011 23:50:33 +0000 Subject: [PATCH] Move and to its own line (unless it's an empty cell) Fixes the other r86004 test case and r86010 one. --- includes/parser/Parser.php | 2 + tests/parser/parserTests.txt | 207 +++++++++++++++++++++++------------ 2 files changed, 140 insertions(+), 69 deletions(-) diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index d6fac6892b..a3043ebe25 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -1067,6 +1067,8 @@ class Parser { $return .= '>'; $return .= $table[$i][$j]['content']; + if ( $table[$i][$j]['content'] != '' ) + $return .= "\n"; $return .= ''; unset( $table[$i][$j] ); diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 706d33b1f3..9823ef0f0f 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -1255,12 +1255,16 @@ Simple table !! result - - + + - - + +
121 +2 +
343 +4 +
@@ -1295,41 +1299,65 @@ Multiplication table -× -1 -2 -3 +× + +1 + +2 + +3 + -1 -1 -2 -3 +1 + +1 + +2 + +3 + -2 -2 -4 -6 +2 + +2 + +4 + +6 + -3 -3 -6 -9 +3 + +3 + +6 + +9 + -4 -4 -8 -12 +4 + +4 + +8 + +12 + -5 -5 -10 -15 +5 + +5 + +10 + +15 + @@ -1349,13 +1377,18 @@ Table rowspan !! result - - - + + + - - + +
Cell 1, row 1Cell 2, row 1 (and 2)Cell 3, row 1Cell 1, row 1 +Cell 2, row 1 (and 2) +Cell 3, row 1 +
Cell 1, row 2Cell 3, row 2Cell 1, row 2 +Cell 3, row 2 +
@@ -1377,17 +1410,22 @@ Nested table !! result - + - +
αα + - + - + -
nestednested +
tabletable +
the original table again
+ +the original table again + @@ -1402,7 +1440,8 @@ Invalid attributes in table cell (bug 1830) !! result - +
brokenbroken +
@@ -1439,7 +1478,8 @@ A table with a caption with unclosed italic caption -Cell +Cell + @@ -1454,7 +1494,8 @@ A table with unclosed italic in a cell !! result - +
CellCell +
@@ -1471,8 +1512,10 @@ A table with unclosed italic in a th !! result - - + +
CellValueCell +Value +
@@ -1486,8 +1529,10 @@ Table security: embedded pipes (http://lists.wikimedia.org/mailman/htdig/wikitec !! result - - + +
[ftp://%7Cx]" onmouseover="alert(document.cookie)">test[ftp://%7Cx +]" onmouseover="alert(document.cookie)">test +
@@ -1504,12 +1549,16 @@ Indented Tables, bug 20078 !! result
- - + + - - + +
121 +2 +
343 +4 +
@@ -2773,7 +2822,8 @@ BUG 553: link with two variables in a piped link !! result - +
[[{{{1}}}|{{{2}}}]][[{{{1}}}|{{{2}}}]] +
@@ -2884,12 +2934,16 @@ foo {{table}}

- - + + - - + +
121 +2 +
343 +4 +
@@ -2905,12 +2959,16 @@ foo

- - + + - - + +
121 +2 +
343 +4 +
@@ -4461,7 +4519,8 @@ Table multiple attributes correction !! result - +
statusstatus +
@@ -4907,7 +4966,8 @@ Table attribute legitimate extension !! result - +
statusstatus +
@@ -4922,7 +4982,8 @@ Table attribute safety !! result - +
statusstatus +
@@ -5577,7 +5638,8 @@ Fuzz testing: Parser14-table

[edit] a

- +
foofoo +
@@ -5594,7 +5656,8 @@ noxml !! result - + @@ -5612,7 +5675,8 @@ Fuzz testing: Parser21 !! result
https://https:// +
- +
irc://{{ftp://a" onmouseover="alert('hello world');"irc://{{ftp://a" onmouseover="alert('hello world');" +
@@ -5672,7 +5736,8 @@ MOVE YOUR MOUSE CURSOR OVER THIS TEXT

- +
+
@@ -7843,12 +7908,16 @@ y

- - + + - - + +
121 +2 +
343 +4 +

y

-- 2.20.1