mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-14 19:29:44 +00:00
MMV: Allow <sub> and <sup> in captions
As we already allow visual markup in captions, I see no reason to not whitelist sup and sub. These elements are even allowed in the displaytitle whitelist for articles, so seems appropriate to have them for media captions as well. Bug: T186844 Change-Id: I4339ee85d139301770a4e15650c9dc0d64c136cd
This commit is contained in:
parent
1657e4241e
commit
340e7680a1
|
@ -222,7 +222,7 @@
|
|||
$html = this.wrapAndJquerify( html );
|
||||
this.filterInvisible( $html );
|
||||
this.appendWhitespaceToBlockElements( $html );
|
||||
this.whitelistHtml( $html, 'a, span, i, b' );
|
||||
this.whitelistHtml( $html, 'a, span, i, b, sup, sub' );
|
||||
cache.textWithTags[ html ] = this.mergeWhitespace( $html.html() );
|
||||
}
|
||||
return cache.textWithTags[ html ];
|
||||
|
|
|
@ -168,9 +168,9 @@
|
|||
|
||||
QUnit.test( 'htmlToTextWithTags()', function ( assert ) {
|
||||
var utils = new mw.mmv.HtmlUtils(),
|
||||
html = '<table><tr><td><b>F</b>o<i>o</i></td><td><a>bar</a></td><td style="display: none">baz</td></tr></table>';
|
||||
html = '<table><tr><td><b>F</b>o<i>o</i><sub>o</sub><sup>o</sup></td><td><a>bar</a></td><td style="display: none">baz</td></tr></table>';
|
||||
|
||||
assert.strictEqual( utils.htmlToTextWithTags( html ), '<b>F</b>o<i>o</i> <a>bar</a>', 'works' );
|
||||
assert.strictEqual( utils.htmlToTextWithTags( html ), '<b>F</b>o<i>o</i><sub>o</sub><sup>o</sup> <a>bar</a>', 'works' );
|
||||
} );
|
||||
|
||||
QUnit.test( 'isJQueryOrHTMLElement()', function ( assert ) {
|
||||
|
|
Loading…
Reference in a new issue