2 var mwLanguageCache = {}, formatText, formatParse, formatnumTests, specialCharactersPageName,
3 expectedListUsers, expectedEntrypoints;
5 // When the expected result is the same in both modes
6 function assertBothModes( assert, parserArguments, expectedResult, assertMessage ) {
7 assert.equal( formatText.apply( null, parserArguments ), expectedResult, assertMessage + ' when format is \'text\'' );
8 assert.equal( formatParse.apply( null, parserArguments ), expectedResult, assertMessage + ' when format is \'parse\'' );
11 QUnit.module( 'mediawiki.jqueryMsg', QUnit.newMwEnvironment( {
13 this.orgMwLangauge = mw.language;
14 mw.language = $.extend( true, {}, this.orgMwLangauge );
16 // Messages that are reused in multiple tests
18 // The values for gender are not significant,
19 // what matters is which of the values is choosen by the parser
20 'gender-msg': '$1: {{GENDER:$2|blue|pink|green}}',
22 'plural-msg': 'Found $1 {{PLURAL:$1|item|items}}',
24 // Assume the grammar form grammar_case_foo is not valid in any language
25 'grammar-msg': 'Przeszukaj {{GRAMMAR:grammar_case_foo|{{SITENAME}}}}',
27 'formatnum-msg': '{{formatnum:$1}}',
29 'portal-url': 'Project:Community portal',
30 'see-portal-url': '{{Int:portal-url}} is an important community page.',
32 'jquerymsg-test-statistics-users': '注册[[Special:ListUsers|用户]]',
34 'jquerymsg-test-version-entrypoints-index-php': '[https://www.mediawiki.org/wiki/Manual:index.php index.php]',
36 'external-link-replace': 'Foo [$1 bar]'
40 wgArticlePath: '/wiki/$1'
43 specialCharactersPageName = '"Who" wants to be a millionaire & live on \'Exotic Island\'?';
45 expectedListUsers = '注册<a title="Special:ListUsers" href="/wiki/Special:ListUsers">用户</a>';
47 expectedEntrypoints = '<a href="https://www.mediawiki.org/wiki/Manual:index.php">index.php</a>';
49 formatText = mw.jqueryMsg.getMessageFunction( {
53 formatParse = mw.jqueryMsg.getMessageFunction( {
57 teardown: function () {
58 mw.language = this.orgMwLangauge;
62 function getMwLanguage( langCode, cb ) {
63 if ( mwLanguageCache[langCode] !== undefined ) {
64 mwLanguageCache[langCode].add( cb );
67 mwLanguageCache[langCode] = $.Callbacks( 'once memory' );
68 mwLanguageCache[langCode].add( cb );
70 url: mw.util.wikiScript( 'load' ),
72 skin: mw.config.get( 'skin' ),
74 debug: mw.config.get( 'debug' ),
76 'mediawiki.language.data',
82 } ).done(function () {
83 mwLanguageCache[langCode].fire( mw.language );
84 } ).fail( function () {
85 mwLanguageCache[langCode].fire( false );
89 QUnit.test( 'Replace', 9, function ( assert ) {
90 mw.messages.set( 'simple', 'Foo $1 baz $2' );
92 assert.equal( formatParse( 'simple' ), 'Foo $1 baz $2', 'Replacements with no substitutes' );
93 assert.equal( formatParse( 'simple', 'bar' ), 'Foo bar baz $2', 'Replacements with less substitutes' );
94 assert.equal( formatParse( 'simple', 'bar', 'quux' ), 'Foo bar baz quux', 'Replacements with all substitutes' );
96 mw.messages.set( 'plain-input', '<foo foo="foo">x$1y<</foo>z' );
99 formatParse( 'plain-input', 'bar' ),
100 '<foo foo="foo">xbary&lt;</foo>z',
101 'Input is not considered html'
104 mw.messages.set( 'plain-replace', 'Foo $1' );
107 formatParse( 'plain-replace', '<bar bar="bar">></bar>' ),
108 'Foo <bar bar="bar">&gt;</bar>',
109 'Replacement is not considered html'
112 mw.messages.set( 'object-replace', 'Foo $1' );
115 formatParse( 'object-replace', $( '<div class="bar">></div>' ) ),
116 'Foo <div class="bar">></div>',
117 'jQuery objects are preserved as raw html'
121 formatParse( 'object-replace', $( '<div class="bar">></div>' ).get( 0 ) ),
122 'Foo <div class="bar">></div>',
123 'HTMLElement objects are preserved as raw html'
127 formatParse( 'object-replace', $( '<div class="bar">></div>' ).toArray() ),
128 'Foo <div class="bar">></div>',
129 'HTMLElement[] arrays are preserved as raw html'
133 formatParse( 'external-link-replace', 'http://example.org/?x=y&z' ),
134 'Foo <a href="http://example.org/?x=y&z">bar</a>',
135 'Href is not double-escaped in wikilink function'
139 QUnit.test( 'Plural', 3, function ( assert ) {
140 assert.equal( formatParse( 'plural-msg', 0 ), 'Found 0 items', 'Plural test for english with zero as count' );
141 assert.equal( formatParse( 'plural-msg', 1 ), 'Found 1 item', 'Singular test for english' );
142 assert.equal( formatParse( 'plural-msg', 2 ), 'Found 2 items', 'Plural test for english' );
145 QUnit.test( 'Gender', 11, function ( assert ) {
146 // TODO: These tests should be for mw.msg once mw.msg integrated with mw.jqueryMsg
147 // TODO: English may not be the best language for these tests. Use a language like Arabic or Russian
150 user.options.set( 'gender', 'male' );
152 formatParse( 'gender-msg', 'Bob', 'male' ),
154 'Masculine from string "male"'
157 formatParse( 'gender-msg', 'Bob', user ),
159 'Masculine from mw.user object'
162 user.options.set( 'gender', 'unknown' );
164 formatParse( 'gender-msg', 'Foo', user ),
166 'Neutral from mw.user object' );
168 formatParse( 'gender-msg', 'Alice', 'female' ),
170 'Feminine from string "female"' );
172 formatParse( 'gender-msg', 'User' ),
174 'Neutral when no parameter given' );
176 formatParse( 'gender-msg', 'User', 'unknown' ),
178 'Neutral from string "unknown"'
181 mw.messages.set( 'gender-msg-one-form', '{{GENDER:$1|User}}: $2 {{PLURAL:$2|edit|edits}}' );
184 formatParse( 'gender-msg-one-form', 'male', 10 ),
186 'Gender neutral and plural form'
189 formatParse( 'gender-msg-one-form', 'female', 1 ),
191 'Gender neutral and singular form'
194 mw.messages.set( 'gender-msg-lowercase', '{{gender:$1|he|she}} is awesome' );
196 formatParse( 'gender-msg-lowercase', 'male' ),
201 formatParse( 'gender-msg-lowercase', 'female' ),
206 mw.messages.set( 'gender-msg-wrong', '{{gender}} test' );
208 formatParse( 'gender-msg-wrong', 'female' ),
210 'Invalid syntax should result in {{gender}} simply being stripped away'
214 QUnit.test( 'Grammar', 2, function ( assert ) {
215 assert.equal( formatParse( 'grammar-msg' ), 'Przeszukaj ' + mw.config.get( 'wgSiteName' ), 'Grammar Test with sitename' );
217 mw.messages.set( 'grammar-msg-wrong-syntax', 'Przeszukaj {{GRAMMAR:grammar_case_xyz}}' );
218 assert.equal( formatParse( 'grammar-msg-wrong-syntax' ), 'Przeszukaj ', 'Grammar Test with wrong grammar template syntax' );
221 QUnit.test( 'Match PHP parser', mw.libs.phpParserData.tests.length, function ( assert ) {
222 mw.messages.set( mw.libs.phpParserData.messages );
223 $.each( mw.libs.phpParserData.tests, function ( i, test ) {
225 getMwLanguage( test.lang, function ( langClass ) {
228 assert.ok( false, 'Language "' + test.lang + '" failed to load' );
231 mw.config.set( 'wgUserLanguage', test.lang );
232 var parser = new mw.jqueryMsg.parser( { language: langClass } );
234 parser.parse( test.key, test.args ).html(),
242 QUnit.test( 'Links', 6, function ( assert ) {
243 var expectedDisambiguationsText,
244 expectedMultipleBars,
245 expectedSpecialCharacters;
248 The below three are all identical to or based on real messages. For disambiguations-text,
249 the bold was removed because it is not yet implemented.
253 formatParse( 'jquerymsg-test-statistics-users' ),
258 expectedDisambiguationsText = 'The following pages contain at least one link to a disambiguation page.\nThey may have to link to a more appropriate page instead.\nA page is treated as a disambiguation page if it uses a template that is linked from ' +
259 '<a title="MediaWiki:Disambiguationspage" href="/wiki/MediaWiki:Disambiguationspage">MediaWiki:Disambiguationspage</a>.';
261 mw.messages.set( 'disambiguations-text', 'The following pages contain at least one link to a disambiguation page.\nThey may have to link to a more appropriate page instead.\nA page is treated as a disambiguation page if it uses a template that is linked from [[MediaWiki:Disambiguationspage]].' );
263 formatParse( 'disambiguations-text' ),
264 expectedDisambiguationsText,
265 'Wikilink without pipe'
269 formatParse( 'jquerymsg-test-version-entrypoints-index-php' ),
274 // Pipe trick is not supported currently, but should not parse as text either.
275 mw.messages.set( 'pipe-trick', '[[Tampa, Florida|]]' );
277 formatParse( 'pipe-trick' ),
278 'pipe-trick: Parse error at position 0 in input: [[Tampa, Florida|]]',
279 'Pipe trick should return error string.'
282 expectedMultipleBars = '<a title="Main Page" href="/wiki/Main_Page">Main|Page</a>';
283 mw.messages.set( 'multiple-bars', '[[Main Page|Main|Page]]' );
285 formatParse( 'multiple-bars' ),
286 expectedMultipleBars,
290 expectedSpecialCharacters = '<a title=""Who" wants to be a millionaire & live on 'Exotic Island'?" href="/wiki/%22Who%22_wants_to_be_a_millionaire_%26_live_on_%27Exotic_Island%27%3F">"Who" wants to be a millionaire & live on 'Exotic Island'?</a>';
292 mw.messages.set( 'special-characters', '[[' + specialCharactersPageName + ']]' );
294 formatParse( 'special-characters' ),
295 expectedSpecialCharacters,
300 // Tests that {{-transformation vs. general parsing are done as requested
301 QUnit.test( 'Curly brace transformation', 14, function ( assert ) {
302 var oldUserLang = mw.config.get( 'wgUserLanguage' );
304 assertBothModes( assert, ['gender-msg', 'Bob', 'male'], 'Bob: blue', 'gender is resolved' );
306 assertBothModes( assert, ['plural-msg', 5], 'Found 5 items', 'plural is resolved' );
308 assertBothModes( assert, ['grammar-msg'], 'Przeszukaj ' + mw.config.get( 'wgSiteName' ), 'grammar is resolved' );
310 mw.config.set( 'wgUserLanguage', 'en' );
311 assertBothModes( assert, ['formatnum-msg', '987654321.654321'], '987,654,321.654', 'formatnum is resolved' );
313 // Test non-{{ wikitext, where behavior differs
317 formatText( 'jquerymsg-test-statistics-users' ),
318 mw.messages.get( 'jquerymsg-test-statistics-users' ),
319 'Internal link message unchanged when format is \'text\''
322 formatParse( 'jquerymsg-test-statistics-users' ),
324 'Internal link message parsed when format is \'parse\''
329 formatText( 'jquerymsg-test-version-entrypoints-index-php' ),
330 mw.messages.get( 'jquerymsg-test-version-entrypoints-index-php' ),
331 'External link message unchanged when format is \'text\''
334 formatParse( 'jquerymsg-test-version-entrypoints-index-php' ),
336 'External link message processed when format is \'parse\''
339 // External link with parameter
341 formatText( 'external-link-replace', 'http://example.com' ),
342 'Foo [http://example.com bar]',
343 'External link message only substitutes parameter when format is \'text\''
346 formatParse( 'external-link-replace', 'http://example.com' ),
347 'Foo <a href="http://example.com">bar</a>',
348 'External link message processed when format is \'parse\''
351 mw.config.set( 'wgUserLanguage', oldUserLang );
354 QUnit.test( 'Int', 4, function ( assert ) {
355 var newarticletextSource = 'You have followed a link to a page that does not exist yet. To create the page, start typing in the box below (see the [[{{Int:Helppage}}|help page]] for more info). If you are here by mistake, click your browser\'s back button.',
356 expectedNewarticletext,
357 helpPageTitle = 'Help:Contents';
359 mw.messages.set( 'helppage', helpPageTitle );
361 expectedNewarticletext = 'You have followed a link to a page that does not exist yet. To create the page, start typing in the box below (see the ' +
362 '<a title="Help:Contents" href="/wiki/Help:Contents">help page</a> for more info). If you are here by mistake, click your browser\'s back button.';
364 mw.messages.set( 'newarticletext', newarticletextSource );
367 formatParse( 'newarticletext' ),
368 expectedNewarticletext,
369 'Link with nested message'
373 formatParse( 'see-portal-url' ),
374 'Project:Community portal is an important community page.',
378 mw.messages.set( 'newarticletext-lowercase',
379 newarticletextSource.replace( 'Int:Helppage', 'int:helppage' ) );
382 formatParse( 'newarticletext-lowercase' ),
383 expectedNewarticletext,
384 'Link with nested message, lowercase include'
387 mw.messages.set( 'uses-missing-int', '{{int:doesnt-exist}}' );
390 formatParse( 'uses-missing-int' ),
392 'int: where nested message does not exist'
396 // Tests that getMessageFunction is used for non-plain messages with curly braces or
397 // square brackets, but not otherwise.
398 QUnit.test( 'mw.Message.prototype.parser monkey-patch', 22, function ( assert ) {
399 var oldGMF, outerCalled, innerCalled;
402 'curly-brace': '{{int:message}}',
403 'single-square-bracket': '[https://www.mediawiki.org/ MediaWiki]',
404 'double-square-bracket': '[[Some page]]',
405 'regular': 'Other message'
408 oldGMF = mw.jqueryMsg.getMessageFunction;
410 mw.jqueryMsg.getMessageFunction = function () {
417 function verifyGetMessageFunction( key, format, shouldCall ) {
421 message = mw.message( key );
423 assert.strictEqual( outerCalled, shouldCall, 'Outer function called for ' + key );
424 assert.strictEqual( innerCalled, shouldCall, 'Inner function called for ' + key );
427 verifyGetMessageFunction( 'curly-brace', 'parse', true );
428 verifyGetMessageFunction( 'curly-brace', 'plain', false );
430 verifyGetMessageFunction( 'single-square-bracket', 'parse', true );
431 verifyGetMessageFunction( 'single-square-bracket', 'plain', false );
433 verifyGetMessageFunction( 'double-square-bracket', 'parse', true );
434 verifyGetMessageFunction( 'double-square-bracket', 'plain', false );
436 verifyGetMessageFunction( 'regular', 'parse', false );
437 verifyGetMessageFunction( 'regular', 'plain', false );
439 verifyGetMessageFunction( 'jquerymsg-test-pagetriage-del-talk-page-notify-summary', 'plain', false );
440 verifyGetMessageFunction( 'jquerymsg-test-categorytree-collapse-bullet', 'plain', false );
441 verifyGetMessageFunction( 'jquerymsg-test-wikieditor-toolbar-help-content-signature-result', 'plain', false );
443 mw.jqueryMsg.getMessageFunction = oldGMF;
449 number: 987654321.654321,
450 result: '987,654,321.654',
451 description: 'formatnum test for English, decimal seperator'
455 number: 987654321.654321,
456 result: '٩٨٧٬٦٥٤٬٣٢١٫٦٥٤',
457 description: 'formatnum test for Arabic, with decimal seperator'
461 number: '٩٨٧٦٥٤٣٢١٫٦٥٤٣٢١',
464 description: 'formatnum test for Arabic, with decimal seperator, reverse'
470 description: 'formatnum test for Arabic, negative number'
477 description: 'formatnum test for Arabic, negative number, reverse'
481 number: 987654321.654321,
482 result: '987.654.321,654',
483 description: 'formatnum test for Nederlands, decimal seperator'
489 description: 'formatnum test for Nederlands, negative number'
495 description: 'formatnum test for Nederlands'
499 number: 'invalidnumber',
500 result: 'invalidnumber',
501 description: 'formatnum test for Nederlands, invalid number'
505 number: '1000000000',
506 result: '1,00,00,00,000',
507 description: 'formatnum test for Malayalam'
511 number: '-1000000000',
512 result: '-1,00,00,00,000',
513 description: 'formatnum test for Malayalam, negative number'
516 * This will fail because of wrong pattern for ml in MW(different from CLDR)
519 number: '1000000000.000',
520 result: '1,00,00,00,000.000',
521 description: 'formatnum test for Malayalam with decimal place'
526 number: '123456789.123456789',
527 result: '१२,३४,५६,७८९',
528 description: 'formatnum test for Hindi'
532 number: '१२,३४,५६,७८९',
533 result: '१२,३४,५६,७८९',
534 description: 'formatnum test for Hindi, Devanagari digits passed'
538 number: '१२३४५६,७८९',
541 description: 'formatnum test for Hindi, Devanagari digits passed to get integer value'
545 QUnit.test( 'formatnum', formatnumTests.length, function ( assert ) {
546 mw.messages.set( 'formatnum-msg', '{{formatnum:$1}}' );
547 mw.messages.set( 'formatnum-msg-int', '{{formatnum:$1|R}}' );
548 $.each( formatnumTests, function ( i, test ) {
550 getMwLanguage( test.lang, function ( langClass ) {
553 assert.ok( false, 'Language "' + test.lang + '" failed to load' );
556 mw.messages.set(test.message );
557 mw.config.set( 'wgUserLanguage', test.lang ) ;
558 var parser = new mw.jqueryMsg.parser( { language: langClass } );
560 parser.parse( test.integer ? 'formatnum-msg-int' : 'formatnum-msg',
561 [ test.number ] ).html(),
570 QUnit.test( 'HTML', 26, function ( assert ) {
571 mw.messages.set( 'jquerymsg-italics-msg', '<i>Very</i> important' );
573 assertBothModes( assert, ['jquerymsg-italics-msg'], mw.messages.get( 'jquerymsg-italics-msg' ), 'Simple italics unchanged' );
575 mw.messages.set( 'jquerymsg-bold-msg', '<b>Strong</b> speaker' );
576 assertBothModes( assert, ['jquerymsg-bold-msg'], mw.messages.get( 'jquerymsg-bold-msg' ), 'Simple bold unchanged' );
578 mw.messages.set( 'jquerymsg-bold-italics-msg', 'It is <b><i>key</i></b>' );
579 assertBothModes( assert, ['jquerymsg-bold-italics-msg'], mw.messages.get( 'jquerymsg-bold-italics-msg' ), 'Bold and italics nesting order preserved' );
581 mw.messages.set( 'jquerymsg-italics-bold-msg', 'It is <i><b>vital</b></i>' );
582 assertBothModes( assert, ['jquerymsg-italics-bold-msg'], mw.messages.get( 'jquerymsg-italics-bold-msg' ), 'Italics and bold nesting order preserved' );
584 mw.messages.set( 'jquerymsg-italics-with-link', 'An <i>italicized [[link|wiki-link]]</i>' );
587 formatParse( 'jquerymsg-italics-with-link' ),
588 'An <i>italicized <a title="link" href="' + mw.html.escape( mw.util.wikiGetlink( 'link' ) ) + '">wiki-link</i>',
589 'Italics with link inside in parse mode'
593 formatText( 'jquerymsg-italics-with-link' ),
594 mw.messages.get( 'jquerymsg-italics-with-link' ),
595 'Italics with link unchanged in text mode'
598 mw.messages.set( 'jquerymsg-italics-id-class', '<i id="foo" class="bar">Foo</i>' );
600 formatParse( 'jquerymsg-italics-id-class' ),
601 mw.messages.get( 'jquerymsg-italics-id-class' ),
602 'ID and class are allowed'
605 mw.messages.set( 'jquerymsg-italics-onclick', '<i onclick="alert(\'foo\')">Foo</i>' );
607 formatParse( 'jquerymsg-italics-onclick' ),
608 '<i onclick="alert(\'foo\')">Foo</i>',
609 'element with onclick is escaped because it is not allowed'
612 mw.messages.set( 'jquerymsg-script-msg', '<script >alert( "Who put this tag here?" );</script>' );
614 formatParse( 'jquerymsg-script-msg' ),
615 '<script >alert( "Who put this tag here?" );</script>',
616 'Tag outside whitelist escaped in parse mode'
620 formatText( 'jquerymsg-script-msg' ),
621 mw.messages.get( 'jquerymsg-script-msg' ),
622 'Tag outside whitelist unchanged in text mode'
625 mw.messages.set( 'jquerymsg-script-link-msg', '<script>[[Foo|bar]]</script>' );
627 formatParse( 'jquerymsg-script-link-msg' ),
628 '<script><a title="Foo" href="' + mw.html.escape( mw.util.wikiGetlink( 'Foo' ) ) + '">bar</a></script>',
629 'Script tag text is escaped because that element is not allowed, but link inside is still HTML'
632 mw.messages.set( 'jquerymsg-mismatched-html', '<i class="important">test</b>' );
634 formatParse( 'jquerymsg-mismatched-html' ),
635 '<i class="important">test</b>',
636 'Mismatched HTML start and end tag treated as text'
639 // TODO (mattflaschen, 2013-03-18): It's not a security issue, but there's no real
640 // reason the htmlEmitter span needs to be here. It's an artifact of how emitting works.
641 mw.messages.set( 'jquerymsg-script-and-external-link', '<script>alert( "jquerymsg-script-and-external-link test" );</script> [http://example.com <i>Foo</i> bar]' );
643 formatParse( 'jquerymsg-script-and-external-link' ),
644 '<script>alert( "jquerymsg-script-and-external-link test" );</script> <a href="http://example.com"><span class="mediaWiki_htmlEmitter"><i>Foo</i> bar</span></a>',
645 'HTML tags in external links not interfering with escaping of other tags'
648 mw.messages.set( 'jquerymsg-link-script', '[http://example.com <script>alert( "jquerymsg-link-script test" );</script>]' );
650 formatParse( 'jquerymsg-link-script' ),
651 '<a href="http://example.com"><span class="mediaWiki_htmlEmitter"><script>alert( "jquerymsg-link-script test" );</script></span></a>',
652 'Non-whitelisted HTML tag in external link anchor treated as text'
655 // Intentionally not using htmlEqual for the quote tests
656 mw.messages.set( 'jquerymsg-double-quotes-preserved', '<i id="double">Double</i>' );
658 formatParse( 'jquerymsg-double-quotes-preserved' ),
659 mw.messages.get( 'jquerymsg-double-quotes-preserved' ),
660 'Attributes with double quotes are preserved as such'
663 mw.messages.set( 'jquerymsg-single-quotes-normalized-to-double', '<i id=\'single\'>Single</i>' );
665 formatParse( 'jquerymsg-single-quotes-normalized-to-double' ),
666 '<i id="single">Single</i>',
667 'Attributes with single quotes are normalized to double'
670 mw.messages.set( 'jquerymsg-escaped-double-quotes-attribute', '<i style="font-family:"Arial"">Styled</i>' );
672 formatParse( 'jquerymsg-escaped-double-quotes-attribute' ),
673 mw.messages.get( 'jquerymsg-escaped-double-quotes-attribute' ),
674 'Escaped attributes are parsed correctly'
677 mw.messages.set( 'jquerymsg-escaped-single-quotes-attribute', '<i style=\'font-family:'Arial'\'>Styled</i>' );
679 formatParse( 'jquerymsg-escaped-single-quotes-attribute' ),
680 mw.messages.get( 'jquerymsg-escaped-single-quotes-attribute' ),
681 'Escaped attributes are parsed correctly'
685 mw.messages.set( 'jquerymsg-wikitext-contents-parsed', '<i>[http://example.com Example]</i>' );
687 formatParse( 'jquerymsg-wikitext-contents-parsed' ),
688 '<i><a href="http://example.com">Example</a></i>',
689 'Contents of valid tag are treated as wikitext, so external link is parsed'
692 mw.messages.set( 'jquerymsg-wikitext-contents-script', '<i><script>Script inside</script></i>' );
694 formatParse( 'jquerymsg-wikitext-contents-script' ),
695 '<i><span class="mediaWiki_htmlEmitter"><script>Script inside</script></span></i>',
696 'Contents of valid tag are treated as wikitext, so invalid HTML element is treated as text'
699 mw.messages.set( 'jquerymsg-unclosed-tag', 'Foo<tag>bar' );
701 formatParse( 'jquerymsg-unclosed-tag' ),
703 'Nonsupported unclosed tags are escaped'
706 mw.messages.set( 'jquerymsg-self-closing-tag', 'Foo<tag/>bar' );
708 formatParse( 'jquerymsg-self-closing-tag' ),
709 'Foo<tag/>bar',
710 'Self-closing tags don\'t cause a parse error'
714 }( mediaWiki, jQuery ) );