From ff74113bea4575f118263689efc1f65fe32bcfd0 Mon Sep 17 00:00:00 2001 From: Daniel Friesen Date: Sun, 12 May 2013 20:24:08 -0700 Subject: [PATCH] Whitelist the element. Bug: 52468 Change-Id: If4a4882155888606c960237be0fbe7933a85c5f9 --- RELEASE-NOTES-1.22 | 1 + includes/Sanitizer.php | 7 +++++-- includes/tidy.conf | 2 +- tests/parser/parserTests.txt | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index a36d8cfa41..e881434d43 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -173,6 +173,7 @@ production. specific purge. * (bug 25931) Add Special:RandomInCategory. * mediawiki.util: addPortletLink now supports passing a jQuery object as nextnode. +* can now be used inside WikiText. === Bug fixes in 1.22 === * Disable Special:PasswordReset when $wgEnableEmail is false. Previously one diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index fa883fc6b8..dd8b87b5fe 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -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' ) ), diff --git a/includes/tidy.conf b/includes/tidy.conf index 6c947295a6..4c4daed579 100644 --- a/includes/tidy.conf +++ b/includes/tidy.conf @@ -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 and 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 diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index f4a85bc325..5bf4324467 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -866,11 +866,11 @@ Non-html5 tags should be accepted !! end !! test - isn't (yet) valid wikitext (bug 52468) + is valid wikitext (bug 52468) !! input !! result -

<wbr> +

!! end -- 2.20.1