Tables: Fix Bug 20078, add test for it
authorLeo Koppelkamm <diebuche@users.mediawiki.org>
Wed, 13 Apr 2011 20:01:23 +0000 (20:01 +0000)
committerLeo Koppelkamm <diebuche@users.mediawiki.org>
Wed, 13 Apr 2011 20:01:23 +0000 (20:01 +0000)
includes/parser/Parser.php
tests/parser/parserTests.txt

index 5fc2974..3eafec2 100644 (file)
@@ -839,7 +839,7 @@ class Parser {
                        }
                        $matches = array();
 
-                       if ( preg_match( '/^(:*)\{\|(.*)$/', $line , $matches ) ) {
+                       if ( preg_match( '/^(:*)\s*\{\|(.*)$/', $line , $matches ) ) {
                                $tables[] = array();
                                $table =& $this->last( $tables );
                                $table[0] = array(); // first row
index e9f36bb..4114ea5 100644 (file)
@@ -1422,7 +1422,27 @@ Table security: embedded pipes (http://lists.wikimedia.org/mailman/htdig/wikitec
 
 !! end
 
+!! test
+Indented Tables, bug 20078
+!! input
+: {| 
+| 1 || 2
+|- 
+| 3 || 4
+|}
+!! result
+<dl><dd><table>
+<tr>
+<td>1</td>
+<td>2</td>
+</tr>
+<tr>
+<td>3</td>
+<td>4</td>
+</tr>
+</table></dd></dl>
 
+!! end
 ###
 ### Internal links
 ###