Don't parse language converter markup as a cell parameter in tables.
authorC. Scott Ananian <cscott@cscott.net>
Tue, 13 Dec 2016 22:22:25 +0000 (17:22 -0500)
committerC. Scott Ananian <cscott@cscott.net>
Thu, 22 Dec 2016 16:09:50 +0000 (11:09 -0500)
Bug: T153140
Change-Id: I799363727162a0f337652b26bb69fe35c61a8553

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

index 5b2dadd..1ca9dac 100644 (file)
@@ -1183,7 +1183,8 @@ class Parser {
 
                                        # T2553: Note that a '|' inside an invalid link should not
                                        # be mistaken as delimiting cell parameters
-                                       if ( strpos( $cell_data[0], '[[' ) !== false ) {
+                                       # Bug T153140: Neither should language converter markup.
+                                       if ( preg_match( '/\[\[|-\{/', $cell_data[0] ) === 1 ) {
                                                $cell = "{$previous}<{$last_tag}>{$cell}";
                                        } elseif ( count( $cell_data ) == 1 ) {
                                                $cell = "{$previous}<{$last_tag}>{$cell_data[0]}";
index 317ab0f..bc15fea 100644 (file)
@@ -20700,9 +20700,8 @@ language=zh variant=zh-cn
 </dt></dl>
 !! end
 
-# FIXME: This test is currently broken in the PHP parser (bug 52661)
 !! test
-Don't break table handling if language converter markup is in the cell.
+T153140: Don't break table handling if language converter markup is in the cell.
 !! options
 language=sr variant=sr-ec
 !! wikitext
@@ -20714,7 +20713,7 @@ language=sr variant=sr-ec
 <table>
 
 <tr>
-<td>Б}-
+<td> B
 </td></tr></table>
 
 !! html/parsoid