From b186286631caf5199dc9715c8460073d3bb67467 Mon Sep 17 00:00:00 2001 From: Leo Koppelkamm Date: Wed, 13 Apr 2011 20:01:23 +0000 Subject: [PATCH] Tables: Fix Bug 20078, add test for it --- includes/parser/Parser.php | 2 +- tests/parser/parserTests.txt | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 5fc297457a..3eafec25d5 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -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 diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index e9f36bb01d..4114ea5008 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -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 +
+ + + + + + + + +
12
34
+!! end ### ### Internal links ### -- 2.20.1