r85988 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85987‎ | r85988 | r85989 >
Date:20:01, 13 April 2011
Author:diebuche
Status:ok (Comments)
Tags:
Comment:
Tables: Fix Bug 20078, add test for it
Modified paths:
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)
  • /trunk/phase3/tests/parser/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/parser/parserTests.txt
@@ -1422,7 +1422,27 @@
14231423
14241424 !! end
14251425
 1426+!! test
 1427+Indented Tables, bug 20078
 1428+!! input
 1429+: {|
 1430+| 1 || 2
 1431+|-
 1432+| 3 || 4
 1433+|}
 1434+!! result
 1435+<dl><dd><table>
 1436+<tr>
 1437+<td>1</td>
 1438+<td>2</td>
 1439+</tr>
 1440+<tr>
 1441+<td>3</td>
 1442+<td>4</td>
 1443+</tr>
 1444+</table></dd></dl>
14261445
 1446+!! end
14271447 ###
14281448 ### Internal links
14291449 ###
Index: trunk/phase3/includes/parser/Parser.php
@@ -839,7 +839,7 @@
840840 }
841841 $matches = array();
842842
843 - if ( preg_match( '/^(:*)\{\|(.*)$/', $line , $matches ) ) {
 843+ if ( preg_match( '/^(:*)\s*\{\|(.*)$/', $line , $matches ) ) {
844844 $tables[] = array();
845845 $table =& $this->last( $tables );
846846 $table[0] = array(); // first row

Sign-offs

UserFlagDate
Platonidesinspected22:23, 13 April 2011

Comments

#Comment by MaxSem (talk | contribs)   20:03, 13 April 2011

Please explain what that bug is about in commit summary, it's much easier to review this way.

#Comment by DieBuche (talk | contribs)   20:04, 13 April 2011

Ok, will do next time

Status & tagging log