[pmwiki-users] Keep() not preventing further parsing?

Ashish Myles marcianx at gmail.com
Sat Nov 20 11:46:45 CST 2010


On Sat, Nov 20, 2010 at 12:09 PM, Petko Yotov <5ko at 5ko.fr> wrote:
> On Saturday 20 November 2010 05:52:43 Ashish Myles wrote:
>> Even though the MathJax javascript plugin does all the parsing itself,
>> I have to make sure that none of the content between the {$ ... $} and
>> {$$ ... $$} delimiters gets modified. So I used the following two
>> lines:
>>
>> Markup('{$', 'directives', '/\\{\\$(.*?)\\$\\}/e',
>> "Keep('{\$'.PSS('$1').'\$}')");
>> Markup('{$$', '<{$', '/\\{\\$\\$(.*?)\\$\$\\}/e',
>> "Keep('{\$\$'.PSS('$1').'\$\$}')");
>
> Hello. Don't use 'directives', it is too late and some wiki markup was already
> processed at this point. You should try and use '_begin', or '>[=', or
> '<$[phrase]', that is, just after the "escaped text" is processed with '[='.
>

Thank you Petko!  The Markup() lines above had been
copy-paste-modified from jsMath, which is where I got the 'directives'
from; it also seemed appropriate at the time, being before the
'inline's. I went for '>[=' as you suggested, and it worked like a
charm!

Thanks!
Ashish



More information about the pmwiki-users mailing list