C. Scott Ananian has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/327127 )

Change subject: Don't parse language converter markup as a cell parameter in 
tables.
......................................................................

Don't parse language converter markup as a cell parameter in tables.

Bug: T153140
Change-Id: I799363727162a0f337652b26bb69fe35c61a8553
---
M includes/parser/Parser.php
M tests/parser/parserTests.txt
2 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/27/327127/1

diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 435c8fc..13b3744 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -1183,7 +1183,8 @@
 
                                        # Bug 553: 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]}";
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index 2a41822..ec50d86 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -20373,9 +20373,8 @@
 </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
@@ -20387,7 +20386,7 @@
 <table>
 
 <tr>
-<td>Б}-
+<td> B
 </td></tr></table>
 
 !! html/parsoid

-- 
To view, visit https://gerrit.wikimedia.org/r/327127
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I799363727162a0f337652b26bb69fe35c61a8553
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: C. Scott Ananian <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to