(bug 31817) add support for HTML5 <bdi> bidi embed element
authorAmir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Wed, 28 Mar 2012 06:42:34 +0000 (08:42 +0200)
committerBrion Vibber <brion@pobox.com>
Wed, 4 Apr 2012 20:11:55 +0000 (13:11 -0700)
Adding <bdi> to $htmlpairsStatic to allow using this tag.

Adds parser test case to confirm that <bdi> makes it through with 'lang' attribute.

This updated patchset also adds <bdi> to the attribute whitelist with the basic common attribute; allows 'lang' and such to get through.

Change-Id: Ib7e6553f017837cb1d49d5718e288228c17392c0

includes/Sanitizer.php
tests/parser/parserTests.txt

index 196abd9..a2459c4 100644 (file)
@@ -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;
        }
index e0eb60e..e627b44 100644 (file)
@@ -9196,6 +9196,15 @@ nowiki inside link inside heading (bug 18295)
 
 !! end
 
+!! test
+new support for bdi element (bug 31817)
+!! input
+<p dir="rtl" lang="he">ולדימיר לנין (ברוסית: <bdi lang="ru">Владимир Ленин</bdi>, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.</p>
+!! result
+<p dir="rtl" lang="he">ולדימיר לנין (ברוסית: <bdi lang="ru">Владимир Ленин</bdi>, 24 באפריל 1870–22 בינואר 1924) הוא מנהיג פוליטי קומוניסטי רוסי.</p>
+
+!!end
+
 
 TODO:
 more images