diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index 6a568c2d0cd..ec17a0895cf 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -383,7 +383,7 @@ class Sanitizer { 'h2', 'h3', 'h4', 'h5', 'h6', 'cite', 'code', 'em', 's', 'strike', 'strong', 'tt', 'var', 'div', 'center', 'blockquote', 'ol', 'ul', 'dl', 'table', 'caption', 'pre', - 'ruby', 'rt', 'rb', 'rp', 'p', 'span', 'abbr', 'dfn', + 'ruby', 'rb', 'rp', 'rt', 'rtc', 'p', 'span', 'abbr', 'dfn', 'kbd', 'samp', 'data', 'time', 'mark' ); $htmlsingle = array( @@ -1685,10 +1685,10 @@ class Sanitizer { # http://www.whatwg.org/html/text-level-semantics.html#the-ruby-element 'ruby' => $common, # rbc - # rtc 'rb' => $common, - 'rt' => $common, #array_merge( $common, array( 'rbspan' ) ), 'rp' => $common, + 'rt' => $common, #array_merge( $common, array( 'rbspan' ) ), + 'rtc' => $common, # MathML root element, where used for extensions # 'title' may not be 100% valid here; it's XHTML diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index cde7a2d83ee..79c8ade65e8 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -378,7 +378,7 @@ class CoreParserFunctions { // list of disallowed tags for DISPLAYTITLE // these will be escaped even though they are allowed in normal wiki text $bad = array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'div', 'blockquote', 'ol', 'ul', 'li', 'hr', - 'table', 'tr', 'th', 'td', 'dl', 'dd', 'caption', 'p', 'ruby', 'rb', 'rt', 'rp', 'br' ); + 'table', 'tr', 'th', 'td', 'dl', 'dd', 'caption', 'p', 'ruby', 'rb', 'rt', 'rtc', 'rp', 'br' ); // disallow some styles that could be used to bypass $wgRestrictDisplayTitle if ( $wgRestrictDisplayTitle ) { diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index e4d93242e4b..6097370612b 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -1087,7 +1087,7 @@ Non-html5 tags should be accepted

!! end -## a,rtc not permitted +## a not permitted ## i,b,br omitted !! test Text-level semantic html elements in wikitext @@ -1109,7 +1109,7 @@ Text-level semantic html elements in wikitext text text text -明日(Ashita) +明日(Ashita あした) text text text @@ -1132,7 +1132,7 @@ Text-level semantic html elements in wikitext text text text -明日(Ashita) +明日(Ashita あした) text text text @@ -1140,6 +1140,46 @@ Text-level semantic html elements in wikitext

!! end +# test cases taken from +# http://www.w3.org/TR/html5/text-level-semantics.html#the-ruby-element +!! test +Ruby markup (W3C-style) +!! wikitext +; Mono-ruby for individual base characters +: ほん +; Group ruby +: 今日きょう +; Jukugo ruby +: きょう +; Inline ruby +: (とうきょう) +; Double-sided ruby +: jiùjīnshānSan Francisco + + +HeartCœur +ShamrockTrèfle +StarÉtoile + +!! html +
Mono-ruby for individual base characters
+
ほん
+
Group ruby
+
今日きょう
+
Jukugo ruby
+
きょう
+
Inline ruby
+
(とうきょう)
+
Double-sided ruby
+
jiùjīnshānSan Francisco
+

+HeartCœur +ShamrockTrèfle +StarÉtoile + +

+!! end + !! test Non-word characters don't terminate tag names (bug 17663, 40670, 52022) !! wikitext