[pmwiki-users] Proposed change to pmwiki.php: Markup_e

Petko Yotov 5ko at 5ko.fr
Thu Feb 6 16:13:12 CST 2014


I think we can add this. Why the key is named markup_c? This template can be  
used on many places which call PCCF(), is there a better key name?

Petko

John Rankin writes:
> I'd like to suggest a small change to the pmwiki core:
>
> $CallbackFnTemplates = array(
>   ...,
>   'markup_c' => 'return %s;',
>   ...,
> );
>
> ...
>
> function Markup_e($id, $when, $pat, $rep, $tmpl='markup_e') {
>   if (!is_callable($rep)) $rep = PCCF($rep, $tmpl);
>   Markup($id, $when, $pat, $rep);
> }
>
> The reason is that I use a lot of calls to Markup with a /e modifier which
> manipulate the matches but do not use $pagename. Rather than use Markup_e,
> which would make $pagename available to the callback function, I have
> created functions of the form
>
>   xxxHelper($m) { return < transformed $m >; }
>
> Then call Markup( ... , "xxxHelper");
>
> Because I do this in several different recipes, I think it would be better
> if the proposed change was built into the core, rather than making it a
> local customisation.
>
> Comments? Is there a better way to do this?




More information about the pmwiki-users mailing list