From fe0b0270fdb242c1aed6b39c1be4782792f323a5 Mon Sep 17 00:00:00 2001 From: "Amir E. Aharoni" Date: Wed, 28 Mar 2012 08:42:34 +0200 Subject: [PATCH] (bug 31817) add support for HTML5 bidi embed element Adding to $htmlpairsStatic to allow using this tag. Adds parser test case to confirm that makes it through with 'lang' attribute. This updated patchset also adds to the attribute whitelist with the basic common attribute; allows 'lang' and such to get through. Change-Id: Ib7e6553f017837cb1d49d5718e288228c17392c0 --- includes/Sanitizer.php | 6 +++++- tests/parser/parserTests.txt | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index 196abd9f43..a2459c43b5 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -374,7 +374,7 @@ class Sanitizer { if ( !$staticInitialised ) { $htmlpairsStatic = array( # Tags that must be closed - 'b', 'del', 'i', 'ins', 'u', 'font', 'big', 'small', 'sub', 'sup', 'h1', + 'b', 'bdi', 'del', 'i', 'ins', 'u', 'font', 'big', 'small', 'sub', 'sup', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'cite', 'code', 'em', 's', 'strike', 'strong', 'tt', 'var', 'div', 'center', 'blockquote', 'ol', 'ul', 'dl', 'table', 'caption', 'pre', @@ -1611,6 +1611,10 @@ class Sanitizer { # 'title' may not be 100% valid here; it's XHTML # http://www.w3.org/TR/REC-MathML/ 'math' => array( 'class', 'style', 'id', 'title' ), + + # HTML 5 section 4.6 + 'bdi' => $common, + ); return $whitelist; } diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index e0eb60ef67..e627b44636 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -9196,6 +9196,15 @@ nowiki inside link inside heading (bug 18295) !! end +!! test +new support for bdi element (bug 31817) +!! input +

ולדימיר לנין (ברוסית: Владимир Ленин, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.

+!! result +

ולדימיר לנין (ברוסית: Владимир Ленин, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.

+ +!!end + TODO: more images -- 2.20.1