From: Erik Bernhardson Date: Thu, 14 Mar 2019 20:06:27 +0000 (-0700) Subject: Improve RemexStripTagHandler working with tables X-Git-Tag: 1.34.0-rc.0~2481^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=aef02d516d0fb20571120ada7278d1658d4d9222;p=lhc%2Fweb%2Fwiklou.git Improve RemexStripTagHandler working with tables HTML, generated by some infoboxes and perhaps other places, gets stripped in a way that merges words together that should not be merged. Add tr, th, and td to the list of tags that should force word separation. Bug: T218001 Change-Id: Ib374339628b1f543ea4e07f24aa3e3b76f3117b5 --- diff --git a/includes/parser/RemexStripTagHandler.php b/includes/parser/RemexStripTagHandler.php index bf4c09876d..2d75c869ec 100644 --- a/includes/parser/RemexStripTagHandler.php +++ b/includes/parser/RemexStripTagHandler.php @@ -87,7 +87,10 @@ class RemexStripTagHandler implements TokenHandler { 'pre' => true, 'section' => true, 'table' => true, + 'td' => true, 'tfoot' => true, + 'th' => true, + 'tr' => true, 'ul' => true, 'video' => true, ]; diff --git a/tests/phpunit/includes/parser/SanitizerTest.php b/tests/phpunit/includes/parser/SanitizerTest.php index ad8aa1e7eb..1f6f4e873b 100644 --- a/tests/phpunit/includes/parser/SanitizerTest.php +++ b/tests/phpunit/includes/parser/SanitizerTest.php @@ -527,6 +527,7 @@ class SanitizerTest extends MediaWikiTestCase { ], [ '123', '123' ], [ '123', '123' ], + [ '12', '1 2' ], ]; }