Readd support for headings inside tables, broken in r85922 and reported on its CodeRe...
authorPlatonides <platonides@users.mediawiki.org>
Wed, 13 Apr 2011 22:20:14 +0000 (22:20 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Wed, 13 Apr 2011 22:20:14 +0000 (22:20 +0000)
Added testcase for it.
It changes again Parser24.

includes/parser/Parser.php
tests/parser/parserTests.txt

index 3eafec2..4ad1a52 100644 (file)
@@ -955,7 +955,7 @@ class Parser {
                                $output =& $currentElement['content'];
 
                        } else {
-                               $output .= $outLine . "\n";
+                               $output .= "\n$outLine\n";
                        }
                }
 
index 4114ea5..6a703bf 100644 (file)
@@ -1406,6 +1406,23 @@ Invalid attributes in table cell (bug 1830)
 
 !! end
 
+!! test
+Heading inside table (affected by r85922)
+!! input
+{|
+|- valign="top"
+|
+=== Heading ===
+|}
+!! result
+<table>
+
+<tr valign="top">
+<td>
+<h3><span class="editsection">[<a href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Heading">edit</a>]</span> <span class="mw-headline" id="Heading"> Heading </span></h3>
+</td></tr></table>
+
+!! end
 
 !! test
 Table security: embedded pipes (http://lists.wikimedia.org/mailman/htdig/wikitech-l/2006-April/022293.html)
@@ -5578,6 +5595,7 @@ http://===r:::https://b
 # </td>
 # </tr>
 # </table>
+# Known to produce bad XML for now
 !! test
 Fuzz testing: Parser24
 !! options
@@ -5593,9 +5611,10 @@ MOVE YOUR MOUSE CURSOR OVER THIS TEXT
 |
 !! result
 <p>{{{|
-<u class="&#124;">}}}} &gt;
-<br style="onmouseover=&#39;alert(document.cookie);&#39;" />
-</p><p>MOVE YOUR MOUSE CURSOR OVER THIS TEXT
+</p><p><u class="&#124;">}}}} &gt;
+</p><p><br style="onmouseover=&#39;alert(document.cookie);&#39;" />
+</p><p><br />
+MOVE YOUR MOUSE CURSOR OVER THIS TEXT
 </p>
 <table>
 <tr>