https://bugzilla.wikimedia.org/show_bug.cgi?id=22880

           Summary: Parser functions cannot control their output
           Product: MediaWiki
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: Page rendering
        AssignedTo: wikibugs-l@lists.wikimedia.org
        ReportedBy: conrad.ir...@gmail.com
            Blocks: 12974,16474


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.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to