On 2 July 2012 16:02, Daniel Barrett <[email protected]> wrote:
> On 29/06/12 21:42, Daniel Barrett wrote:
>>>> 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 "&amp;". Is there a way to suppress this conversion when returning 
>>> "&" from a parser tag extension?
>>>
>>> DanB
>
> Platonides wrote:
>>Why do you want a plain & ?
>>Seems like you want invalid html...
>
> Because the output may contain JavaScript and it's converting "if (a&&b)" to 
> "if (a&amp;&amp;b)".
>
> The extension is a tag "<javascript>" that adds arbitrary javascript, 
> supplied by the user, to the wiki page. Security is not an issue because this 
> is a completely internal wiki.
>
> Is there a better way to implement a <javascript> parser tag extension so the 
> HTML-conversion issue doesn't happen?
>
> DanB
>
> _______________________________________________
> Wikitech-l mailing list
> [email protected]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l


I don't know, but vanilla MediaWiki has the same problem: "&" inside
<html> tags (when they are allowed by $wgRawHtml=true) gets converted
to "&amp;" which can break javascript.
https://bugzilla.wikimedia.org/show_bug.cgi?id=10407

Pete / the wub

_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to