$last_tag = array_pop( $last_tag_history );
if ( array_pop( $td_history ) ) {
- $previous = "</{$last_tag}>{$previous}";
+ $previous = "</{$last_tag}>\n{$previous}";
}
if ( $first_character === '|' ) {
!! result
<table>
<tr>
-<td> 1 </td><td> 2
+<td> 1 </td>
+<td> 2
</td></tr>
<tr>
-<td> 3 </td><td> 4
+<td> 3 </td>
+<td> 4
</td></tr></table>
!! end
<caption>Multiplication table
</caption>
<tr>
-<th> × </th><th> 1 </th><th> 2 </th><th> 3
+<th> × </th>
+<th> 1 </th>
+<th> 2 </th>
+<th> 3
</th></tr>
<tr>
<th> 1
-</th><td> 1 </td><td> 2 </td><td> 3
+</th>
+<td> 1 </td>
+<td> 2 </td>
+<td> 3
</td></tr>
<tr>
<th> 2
-</th><td> 2 </td><td> 4 </td><td> 6
+</th>
+<td> 2 </td>
+<td> 4 </td>
+<td> 6
</td></tr>
<tr>
<th> 3
-</th><td> 3 </td><td> 6 </td><td> 9
+</th>
+<td> 3 </td>
+<td> 6 </td>
+<td> 9
</td></tr>
<tr>
<th> 4
-</th><td> 4 </td><td> 8 </td><td> 12
+</th>
+<td> 4 </td>
+<td> 8 </td>
+<td> 12
</td></tr>
<tr>
<th> 5
-</th><td> 5 </td><td> 10 </td><td> 15
+</th>
+<td> 5 </td>
+<td> 10 </td>
+<td> 15
</td></tr></table>
!! end
<table align="right" border="1">
<tr>
<td> Cell 1, row 1
-</td><td rowspan="2"> Cell 2, row 1 (and 2)
-</td><td> Cell 3, row 1
+</td>
+<td rowspan="2"> Cell 2, row 1 (and 2)
+</td>
+<td> Cell 3, row 1
</td></tr>
<tr>
<td> Cell 1, row 2
-</td><td> Cell 3, row 2
+</td>
+<td> Cell 3, row 2
</td></tr></table>
!! end
<table border="1">
<tr>
<td> α
-</td><td>
+</td>
+<td>
<table bgcolor="#ABCDEF" border="2">
<tr>
<td>nested
<tr>
<td>table
</td></tr></table>
-</td><td>the original table again
+</td>
+<td>the original table again
</td></tr></table>
!! end
!! end
-# FIXME: It's not clear at all that this is the result we want, but the actual
-# output right now is invalid XML, so clearly something is wrong. The result
-# specified here is now valid XML, which is an improvement . . .
!! test
Table security: embedded pipes (http://lists.wikimedia.org/mailman/htdig/wikitech-l/2006-April/022293.html)
-!! options
-disabled
!! input
{|
| |[ftp://|x||]" onmouseover="alert(document.cookie)">test
!! result
<table>
<tr>
-<td><a href="ftp://%7Cx" class="external text" rel="nofollow">ftp://%7Cx</a></td><td>" onmouseover="alert(document.cookie)">test
+<td>[<a href="ftp://%7Cx" class="external free" rel="nofollow">ftp://%7Cx</a></td>
+<td>]" onmouseover="alert(document.cookie)">test
</td>
</tr>
</table>
</p>
<table>
<tr>
-<td> 1 </td><td> 2
+<td> 1 </td>
+<td> 2
</td></tr>
<tr>
-<td> 3 </td><td> 4
+<td> 3 </td>
+<td> 4
</td></tr></table>
!! end
</p>
<table>
<tr>
-<td> 1 </td><td> 2
+<td> 1 </td>
+<td> 2
</td></tr>
<tr>
-<td> 3 </td><td> 4
+<td> 3 </td>
+<td> 4
</td></tr></table>
!! end
!! result
<table>
<tr>
-<th>https://</th><th></th><th></th><th>
+<th>https://</th>
+<th></th>
+<th></th>
+<th>
</td>
</tr>
</table>
<table>
<tr>
<th> <a href="irc://{{ftp://a" class="external free" rel="nofollow">irc://{{ftp://a</a>" onmouseover="alert('hello world');"
-</th><td>
+</th>
+<td>
</td>
</tr>
</table>
</p>
<table>
<tr>
-<td> 1 </td><td> 2
+<td> 1 </td>
+<td> 2
</td></tr>
<tr>
-<td> 3 </td><td> 4
+<td> 3 </td>
+<td> 4
</td></tr></table>
<p>y
</p>