Last modified: 2013-12-25 14:40:07 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T60961, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 58961 - Support replaceable internal link in module mediawiki.jqueryMsg
Support replaceable internal link in module mediawiki.jqueryMsg
Status: RESOLVED DUPLICATE of bug 47395
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.23.0
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: javascript
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-12-25 11:48 UTC by Fomafix
Modified: 2013-12-25 14:40 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Fomafix 2013-12-25 11:48:09 UTC
Internal link with replace doesn't work in module mediawiki.jqueryMsg:

mw.messages.set( 'external-link', 'Foo [http://example.org/?x=y&z bar]' );
console.log( mw.message( 'external-link' ).parse() );
// Foo <a href="http://example.org/?x=y&amp;z">bar</a>

mw.messages.set( 'external-link-replace', 'Foo [$1 bar]' );
console.log( mw.message( 'external-link-replace', 'http://example.org/?x=y&z' ).parse() );
// Foo <a href="http://example.org/?x=y&amp;z">bar</a>

mw.messages.set( 'internal-link', 'Foo [[Foobar|bar]]' );
console.log( mw.message( 'internal-link' ).parse() );
// Foo <a href="/wiki/Foobar" title="Foobar">bar</a>

mw.messages.set( 'internal-link-replace', 'Foo [[$1|bar]]' );
console.log( mw.message( 'internal-link-replace', 'Foobar' ).parse() );
// internal-link-replace: Parse error at position 4 in input: Foo [[$1|bar]]

Expected result: Foo <a href="/wiki/Foobar" title="Foobar">bar</a>
Comment 1 Bartosz Dziewoński 2013-12-25 14:40:07 UTC

*** This bug has been marked as a duplicate of bug 47395 ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links