Page MenuHomePhabricator

jqueryMsg can not handle external links/wikilinks with dollar signs in the URL/target
Open, MediumPublic

Description

mediawiki.jqueryMsg can not handle external links with dollar signs in the URL. However, those are valid. See bug T2188 and https://en.wikipedia.org/wiki/MediaWiki:Version-entrypoints-articlepath .

External links are defined as:

sequence(openExtlink, nonWhitespaceExpression, whitespace, expression, closeExtlink)

So the URL must go in nonWhitespaceExpression. That in turn is:

choice(template, link, extLinkParam, extlink, replacement, literalWithoutSpace)

This seems overly broad, since I don't think we allow nested external links... However, the one that should match is literalWithoutSpace.

That is nOrMore( 1, escapedOrLiteralWithoutSpace )

escapedOrLiteralWithoutSpace is:

choice(escapedLiteral, regularLiteralWithoutSpace)

So I think the root problem is regularLiteralWithoutSpace, which is:

makeRegexParser(/^[^{}\[\]$\s]/);

I think this should allow $, which means removing it from the negative character class.

See Also: T49395: jqueryMsg can not parse wikilink with parameters in page name

Details

Reference
bz43510

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:12 AM
bzimport set Reference to bz43510.
bzimport added a subscriber: Unknown Object (MLST).
matmarex updated the task description. (Show Details)
matmarex set Security to None.
matmarex removed a subscriber: Unknown Object (MLST).
matmarex subscribed.
matmarex renamed this task from jqueryMsg can not handle external links with dollar signs in the URL to jqueryMsg can not handle external links/wikilinks with dollar signs in the URL/target.Oct 5 2015, 12:22 PM

This applies equally to wikilinks, like [[US$|United States dollar]]. Since T49395, parameters in link target are handled correctly, but "bare" dollar sign isn't.