In a parser tag callback, if I change this:
function myCallback($input, $argv, $parser) { return '&'; }
to this:
function myCallback($input, $argv, $parser) { return array('&', 'markerType' => 'nowiki'); }
shouldn't the second one cause a plain ampersand to be rendered, rather than & ? Reference: http://www.mediawiki.org/wiki/Manual:Tag_extensions#How_can_I_avoid_modifica....
This is MediaWiki 1.18.1.
Thanks, DanB
_____________________________________________ From: Daniel Barrett Sent: Friday, June 29, 2012 3:42 PM To: 'Wikimedia developers' Subject: RE: StripState and ampersands?
How can I prevent this conversion so ampersands (and presumably other special characters) are preserved?
Followup up my own question: StripState is not relevant here. It's the fact that it's a parser tag extension. Simply returning "&" in the callback will produce "&". Is there a way to suppress this conversion when returning "&" from a parser tag extension?
DanB
Not sure, but could it be that tidy at latest would escape that ampersand? This has nothing to do with Wikitext, but just plain HTML -- a sole ampersand is not valid in HTML.
2012/6/29 Daniel Barrett danb@vistaprint.com:
In a parser tag callback, if I change this:
function myCallback($input, $argv, $parser) { return '&'; }
to this:
function myCallback($input, $argv, $parser) { return array('&', 'markerType' => 'nowiki'); }
shouldn't the second one cause a plain ampersand to be rendered, rather than & ? Reference: http://www.mediawiki.org/wiki/Manual:Tag_extensions#How_can_I_avoid_modifica....
This is MediaWiki 1.18.1.
Thanks, DanB
From: Daniel Barrett Sent: Friday, June 29, 2012 3:42 PM To: 'Wikimedia developers' Subject: RE: StripState and ampersands?
How can I prevent this conversion so ampersands (and presumably other special characters) are preserved?
Followup up my own question: StripState is not relevant here. It's the fact that it's a parser tag extension. Simply returning "&" in the callback will produce "&". Is there a way to suppress this conversion when returning "&" from a parser tag extension?
DanB
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
wikitech-l@lists.wikimedia.org