Merge "Remove use of explodeMarkup"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 1 Feb 2016 21:31:27 +0000 (21:31 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 1 Feb 2016 21:31:27 +0000 (21:31 +0000)
includes/parser/Parser.php
tests/parser/parserTests.txt

index 5f7e89c..f947285 100644 (file)
@@ -1113,15 +1113,15 @@ class Parser {
                                        $line = substr( $line, 1 );
                                }
 
+                               // Implies both are valid for table headings.
                                if ( $first_character === '!' ) {
                                        $line = str_replace( '!!', '||', $line );
                                }
 
                                # Split up multiple cells on the same line.
                                # FIXME : This can result in improper nesting of tags processed
-                               # by earlier parser steps, but should avoid splitting up eg
-                               # attribute values containing literal "||".
-                               $cells = StringUtils::explodeMarkup( '||', $line );
+                               # by earlier parser steps.
+                               $cells = explode( '||', $line );
 
                                $outLine = '';
 
index 078fa6c..d866ed8 100644 (file)
@@ -6334,6 +6334,24 @@ parsoid=wt2html,html2html
 <td data-parsoid='{"startTagSrc":"| ","attrSepSrc":"|","autoInsertedEnd":true}'><a rel="mw:ExtLink" href="ftp://|x||"></a>" onmouseover="alert(document.cookie)">test</td></tr></tbody></table>
 !! end
 
+!! test
+! and || in element attributes should not be parsed as <th>/<td>
+!! wikitext
+{|
+| <div style="color: red !important;" data-contrived="put this here ||">hi</div>
+|}
+!! html/php
+<table>
+<tr>
+<td> <div style="color: red !important;" data-contrived="put this here &#124;&#124;">hi</div>
+</td></tr></table>
+
+!! html/parsoid
+<table>
+<tbody><tr><td> <div style="color: red !important;" data-contrived="put this here ||" data-parsoid='{"stx":"html"}'>hi</div></td></tr>
+</tbody></table>
+!! end
+
 # FIXME: The output seems broken. Filed as T110268.
 !! test
 ! and || in td attributes should not be parsed as <th>/<td>