Krinkle has uploaded a new change for review.
https://gerrit.wikimedia.org/r/162013
Change subject: mediawiki.jqueryMsg: Add broken test case for PLURAL with
extlink
......................................................................
mediawiki.jqueryMsg: Add broken test case for PLURAL with extlink
PLURAL and extlink work fine independently, but when put together
the PLURAL incorrectly replaces the mediaWiki_htmlEmitter node with
flat html in mw.jqueryMsg.htmlEmitter#plural, thus causing it to
be treated as a text node foward and escaped again.
Change-Id: Iacecc2c53da98280477b4dae6ff520e60d1dadd2
---
M tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js
1 file changed, 13 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/13/162013/1
diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js
b/tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js
index 906fd27..fe0e4bb 100644
--- a/tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js
+++ b/tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js
@@ -54,7 +54,8 @@
'jquerymsg-test-version-entrypoints-index-php':
'[https://www.mediawiki.org/wiki/Manual:index.php index.php]',
- 'external-link-replace': 'Foo [$1 bar]'
+ 'external-link-replace': 'Foo [$1 bar]',
+ 'external-link-plural': 'Foo {{PLURAL:$1|is [$2
one]|are [$2 some]}} things.'
}
} ) );
@@ -85,7 +86,7 @@
} );
}
- QUnit.test( 'Replace', 9, function ( assert ) {
+ QUnit.test( 'Replace', 11, function ( assert ) {
mw.messages.set( 'simple', 'Foo $1 baz $2' );
assert.equal( formatParse( 'simple' ), 'Foo $1 baz $2',
'Replacements with no substitutes' );
@@ -133,6 +134,16 @@
'Foo <a href="http://example.org/?x=y&z">bar</a>',
'Href is not double-escaped in wikilink function'
);
+ assert.equal(
+ formatParse( 'external-link-plural', 1,
'http://example.org' ),
+ 'Foo is <a href="http://example.org">one</a> things.',
+ ''
+ );
+ assert.equal(
+ formatParse( 'external-link-plural', 2,
'http://example.org' ),
+ 'Foo are <a href="http://example.org">some</a> things.',
+ ''
+ );
} );
QUnit.test( 'Plural', 6, function ( assert ) {
--
To view, visit https://gerrit.wikimedia.org/r/162013
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iacecc2c53da98280477b4dae6ff520e60d1dadd2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits