From 23fd64afde218cdd54f3a21980c029f31b507b65 Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Tue, 13 Dec 2016 17:22:25 -0500 Subject: [PATCH] Don't parse language converter markup as a cell parameter in tables. Bug: T153140 Change-Id: I799363727162a0f337652b26bb69fe35c61a8553 --- includes/parser/Parser.php | 3 ++- tests/parser/parserTests.txt | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 5b2daddd23..1ca9dacfc8 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -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]}"; diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 317ab0f60a..bc15feaef9 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -20700,9 +20700,8 @@ language=zh variant=zh-cn !! 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 -
Б}- + B
!! html/parsoid -- 2.20.1