Last modified: 2011-04-14 15:12:11 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 T24880, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 22880 - Parser functions cannot control their output
Parser functions cannot control their output
Status: NEW
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Low normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 12974 16474 UNIQ
  Show dependency treegraph
 
Reported: 2010-03-18 12:34 UTC by Conrad Irwin
Modified: 2011-04-14 15:12 UTC (History)
1 user (show)

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


Attachments

Description Conrad Irwin 2010-03-18 12:34:34 UTC
At the moment some parser functions/variables output is partially escaped and partially treated as wikitext (using wfEscapeWikiText). This breaks both parsing and the use of the output of one variable as input to another, see:

{{PAGENAME}} on [[*]]
{{urlencode:{{PAGENAME}}}} on [[&]]

The solution I propose is to add a new class of UNIQ tags to the parser. Extensions can "return $parser->armouredText( $text );" where they currently "return wfEscapeWikiText( $text )".

The parser should have two replacements for each armouredText, when calling further parser functions, it replaces it with the original; when outputting, it replaces it with the escaped version (at the same time <nowiki> is re-expanded). The ugliness is that it will require several changes to allow armouredText UNIQs to be part of links/template names/magic words.

A much hackier alternatively is an inclusion prefix or two (cf. msg: int: msgnw:) that could be added such that {{plain:PAGENAME}} returns the unescaped version, while {{armour:PAGENAME}} puts it into one of the existing nowiki UNIQs - but this really shouldn't be exposed to users.
Comment 1 Mormegil 2010-03-18 13:08:49 UTC
Isn’t this just a duplicate of bug #12974?
Comment 2 Conrad Irwin 2010-03-18 13:14:58 UTC
Fixing this would fix some (but not all) of the problems caused by bug 12974, and vice versa, but they are not duplicates.

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


Navigation
Links