[pmwiki-devel] PTVs using MarkupExpr, in a Pagelist

DaveG pmwiki at solidgone.com
Mon Jan 19 11:03:20 CST 2009


Peter Bowers wrote:
> On this page:
> 
> 	http://www.pmwiki.org/wiki/Cookbook/DebuggingForCookbookAuthors
> 
> At the very bottom of that page I have documented a modification which I
> make to pmwiki.php in the MarkupToHTML() function.  
Very useful, thanks. Also, a *lot* of iterations for even a very simple 
page.

It seems like {$$vars} are handled and processed differently to other 
vars. A test (below) indicates that {$$vars} do not trigger a 
'reprocess' as other vars appear to. I've moved earlymx procesing to 
after var:
   Markup('{earlymx(', '>{$var}',
     '/\\{earlymx(\\(\\w+\\b.*?\\))\\}/e',
     "MarkupExpression(\$pagename, PSS('$1'))");



===Test.Main
(:include Test.Include in="mnopqrstuvwxyz":)


===Test.Include
PName is {$FullName}

Inbound param {$$in}

varinEarly:{earlymx(substr "{$$in}" 1 10)}

varinNotEarly:{$$in}

var:{earlymx(substr {$FullName} 3 7)}

var is {$:var}

varinEarly is {$:varinEarly}

varinNotEarly is {$:varinNotEarly}


===Results in:
PName is Blog.Include

Inbound param mnopqrstuvwxyz
varinEarly:nopqrstuvw
varinNotEarly:mnopqrstuvwxyz
var:g.Inclu

var is g.Inclu

varinEarly is $$in}

varinNotEarly is {$$in}

===
The last line is the interesting one. Even though varinNotEarly shows 
the correct result, the actual value of varinNotEarly is incorrect. PTVs 
seem to work okay as the "var is " line shows.

So is this a bug, or there some reason why {$$var} is not handled the 
same as other vars.

  ~ ~ David



More information about the pmwiki-devel mailing list