Whitelist the <wbr> element.
authorDaniel Friesen <daniel@nadir-seen-fire.com>
Mon, 13 May 2013 03:24:08 +0000 (20:24 -0700)
committerRelease notes rebase bot <matma.rex+releasenotesrebasebot@gmail.com>
Fri, 2 Aug 2013 19:12:12 +0000 (21:12 +0200)
Bug: 52468
Change-Id: If4a4882155888606c960237be0fbe7933a85c5f9

RELEASE-NOTES-1.22
includes/Sanitizer.php
includes/tidy.conf
tests/parser/parserTests.txt

index a36d8cf..e881434 100644 (file)
@@ -173,6 +173,7 @@ production.
   specific purge.
 * (bug 25931) Add Special:RandomInCategory.
 * mediawiki.util: addPortletLink now supports passing a jQuery object as nextnode.
+* <wbr> can now be used inside WikiText.
 
 === Bug fixes in 1.22 ===
 * Disable Special:PasswordReset when $wgEnableEmail is false. Previously one
index fa883fc..dd8b87b 100644 (file)
@@ -385,10 +385,10 @@ class Sanitizer {
                                'kbd', 'samp', 'data', 'time', 'mark'
                        );
                        $htmlsingle = array(
-                               'br', 'hr', 'li', 'dt', 'dd'
+                               'br', 'wbr', 'hr', 'li', 'dt', 'dd'
                        );
                        $htmlsingleonly = array( # Elements that cannot have close tags
-                               'br', 'hr'
+                               'br', 'wbr', 'hr'
                        );
                        if ( $wgAllowMicrodataAttributes ) {
                                $htmlsingle[] = $htmlsingleonly[] = 'meta';
@@ -1536,6 +1536,9 @@ class Sanitizer {
                        # 9.3.2
                        'br'         => array( 'id', 'class', 'title', 'style', 'clear' ),
 
+                       # http://www.whatwg.org/html/text-level-semantics.html#the-wbr-element
+                       'wbr'        => array( 'id', 'class', 'title', 'style' ),
+
                        # 9.3.4
                        'pre'        => array_merge( $common, array( 'width' ) ),
 
index 6c94729..4c4daed 100644 (file)
@@ -18,5 +18,5 @@ fix-backslash: no
 fix-uri: no
 # Don't strip html5 elements we support
 # html-{meta,link} is a hack we use to prevent Tidy from stripping <meta> and <link> used in the body for Microdata
-new-empty-tags: html-meta, html-link
+new-empty-tags: html-meta, html-link, wbr
 new-inline-tags: video, audio, source, track, bdi, data, time, mark
index f4a85bc..5bf4324 100644 (file)
@@ -866,11 +866,11 @@ Non-html5 tags should be accepted
 !! end
 
 !! test
-<wbr> isn't (yet) valid wikitext (bug 52468)
+<wbr> is valid wikitext (bug 52468)
 !! input
 <wbr>
 !! result
-<p>&lt;wbr&gt;
+<p><wbr />
 </p>
 !! end