Don't replace !! in elements
authorArlo Breault <abreault@wikimedia.org>
Fri, 5 Feb 2016 16:00:56 +0000 (08:00 -0800)
committerTim Starling <tstarling@wikimedia.org>
Wed, 6 Apr 2016 06:23:48 +0000 (06:23 +0000)
commit9b510882d79549bdc6be3b89d10f67d3f6c5da2d
tree23d3b22002408db0c2056b30e6256b383309021f
parent0e19c78ca79f1ae519a6a8cf472594f40ba7fd78
Don't replace !! in elements

 * 55313f4e almost got it right, but missed the str_replacing table
   headings.

 * Thankfully, this was doubly broken before that patch since the
   StringUtils::explodeMarkup would have skipped the || which would
   go on to be explode by table cell attribute parsing. The test case
   provided would look like,

   <table>
   <tr>
   <th class="">|">ha</div> ho
   </th></tr></table>

   Suffice it to say, noone is using this in production.

 * Note that we can't just entity encode the ! since that would break
   style attributes with !important.

 * Also note, Parsoid already gets this right.

 * Adds a StringUtils::replaceMarkup

Change-Id: Iab3ae4518fcb307b795d57eece420ba48af0a3bf
includes/libs/StringUtils.php
includes/parser/Parser.php
tests/parser/parserTests.txt