Last modified: 2012-02-22 12:40:25 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 19144 - {{#if:}} inside external link causes the link to be parsed wrongly
{{#if:}} inside external link causes the link to be parsed wrongly
Status: RESOLVED DUPLICATE of bug 12974
Product: MediaWiki extensions
Classification: Unclassified
ParserFunctions (Other open bugs)
PC Linux
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2009-06-10 10:59 UTC by Colin Fine
Modified: 2012-02-22 12:40 UTC (History)
1 user (show)

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


Description Colin Fine 2009-06-10 10:59:25 UTC
I have a template that is generating external links ([ ...])

If part of the link includes an {{#if:}} construct, some characters are not parsed correctly, but actually terminate the link construct.

I have seen two different cases:

1. a '#' in the replacement text ends the link.

[ My site]
 correctly shows 'My site', with a link to

 [{{#if:anchor|#anchor}} My site]
expands to
   1. anchor My site]
as though it were
  #anchor My site ]
(including treating the '#' as a numbered list item).

Using nowiki helps, but still gives a different wrong result:
 [{{#if:anchor|<nowiki>#</nowiki>anchor}} My site
expands as though it were 
 [ <nowiki>#</nowiki>anchor My site]

The workround I have is to put the # outside the #if:
 [{{#if:anchor|anchor}} My site]
This works, but of course it always generates the # on the link.

2. a ':' has similar problems, but not quite so bad, presumably because it is not so special to Mediawiki. The nowiki trick works here.

MW 1.13.2, ParseFunctions 1.1.1
Comment 1 Splarka 2009-06-10 11:03:38 UTC

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

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