* (bug 7851) Implemented one-click AJAX patrolling.
* The <data>, <time>, <meta>, and <link> elements are allowed within WikiText
for use with Microdata.
+* The HTML5 <mark> tag has been whitelisted.
=== Bug fixes in 1.21 ===
* (bug 40353) SpecialDoubleRedirect should support interwiki redirects.
'kbd', 'samp'
);
if ( $wgHtml5 ) {
- $htmlpairsStatic = array_merge( $htmlpairsStatic, array( 'data', 'time' ) );
+ $htmlpairsStatic = array_merge( $htmlpairsStatic, array( 'data', 'time', 'mark' ) );
}
$htmlsingle = array(
'br', 'hr', 'li', 'dt', 'dd'
$whitelist += array(
'data' => array_merge( $common, array( 'value' ) ),
'time' => array_merge( $common, array( 'datetime' ) ),
+ 'mark' => $common,
// meta and link are only permitted by removeHTMLtags when Microdata
// is enabled so we don't bother adding a conditional to hide these
# 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-inline-tags: video, audio, source, track, bdi, data, time
+new-inline-tags: video, audio, source, track, bdi, data, time, mark
direction: rtl;
}
+/* User-Agent styles for new HTML5 elements */
+mark {
+ background-color: yellow;
+ color: black;
+}
+
/* Input types that should follow user direction, like buttons */
/* TODO: What about buttons in wikipage content ? */
input[type="submit"],
$this->assertEquals( UTF8_REPLACEMENT, Sanitizer::decodeCharReferences( "�" ), 'Invalid numbered entity' );
}
+ /**
+ * @cover Sanitizer::removeHTMLtags
+ * @dataProvider provideHtml5Tags
+ *
+ * @param String $tag Name of an HTML5 element (ie: 'video')
+ * @param Boolean $escaped Wheter sanitizer let the tag in or escape it (ie: '<video>')
+ */
+ function testRemovehtmltagsOnHtml5Tags( $tag, $escaped ) {
+
+ # Enable HTML5 mode
+ global $wgHTML5;
+ $save = $wgHTML5;
+ $wgHTML5 = true;
+
+ if( $escaped ) {
+ $this->assertEquals( "<$tag>",
+ Sanitizer::removeHTMLtags( "<$tag>" )
+ );
+ } else {
+ $this->assertEquals( "<$tag></$tag>\n",
+ Sanitizer::removeHTMLtags( "<$tag>" )
+ );
+ }
+ $wgHTML5 = $save;
+ }
+
+ /**
+ * Provide HTML5 tags
+ */
+ function provideHtml5Tags() {
+ $ESCAPED = true; # We want tag to be escaped
+ $VERBATIM = false; # We want to keep the tag
+ return array(
+ array( 'data', $VERBATIM ),
+ array( 'mark', $VERBATIM ),
+ array( 'time', $VERBATIM ),
+ array( 'video', $ESCAPED ),
+ );
+ }
+
function testSelfClosingTag() {
$GLOBALS['wgUseTidy'] = false;
$this->assertEquals(