"Robert Rohde" <[email protected]> wrote in message 
news:[email protected]...
On Tue, Oct 6, 2009 at 4:47 PM, Mark Clements (HappyDog) 
<[email protected]> wrote:
[SNIP - Re: ParserAfterStrip]
>> On MW 1.14 and above the code within the <nowiki> tags is parsed and ends 
>> up
>> having the regex applied to it, though it is subsequently rendered as 
>> plain
>> text by the engine (so the page ends up being filled with HTML/CSS
>> gobbledygook, rendered literally).
>>
>> I am not sure at which revision this change took place.
>>
>> First question: Is this a bug or a deliberate change in functionality, or
>> have I been mis-using the hook all along?
>
> This was changed during the parser rewrite several versions ago.  The
> restructuring of the parser meant that strip markers are now handled
> differently and can't be routed around using that hook anymore.
> ParserAfterStrip is essentially a deprecated legacy that now functions
> the same way as ParserBeforeStrip.

I have updated the page on MW.org [1] to explain this.  However, can someone 
confirm that this is a deliberate change?  To me it seems like a regression 
that has not been spotted!  (Or is it that the parser has changed to the 
point where it is no longer possible to have a ParserAfterStrip hook?)

>> Second question: Assuming this is not a bug, how should I rewrite the 
>> code
>> to make it behave as it used to?
>
> I haven't studied you code in detail, but I would suggest that using
> the LinkBegin hook (available 1.14+) is probably the right place to
> look in the current versions of Mediawiki:
>

Thanks - I ended up needing a combination of LinkBegin/LinkEnd to get the 
result I wanted.  You can see the code at 
http://www.kennel17.co.uk/testwiki/BugSquish

Thanks for your help,

- Mark Clements (HappyDog)

[1] http://www.mediawiki.org/wiki/Manual:Hooks/ParserAfterStrip 



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

Reply via email to