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

John Rankin john.rankin at affinity.co.nz
Wed Feb 5 15:57:35 CST 2014


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?

JR
-- 
John Rankin




More information about the pmwiki-users mailing list