[pmwiki-users] httpvariables & markupexpressions

Patrick R. Michaud pmichaud at pobox.com
Wed Apr 2 14:15:13 CDT 2008

On Wed, Apr 02, 2008 at 06:33:40PM +0200, Peter & Melodye Bowers wrote:
> ===(snip from httpvariables - yes there are 2 almost identical rules)===
> # {$?!|@~var} http variable substitutions before {$var}
> Markup('{$?|!@~var}', '<{$var}',
>   '/\\{\\$([\\?\\!\\|@~])(\\w+)\\}/e',
>   "HttpVariables(\$pagename, PSS('$1'), PSS('$2'))");
> # {$?!|@~var} http variable substitutions after {$var}
> Markup('{$?|!@~var}', '>{$var}',
>   '/\\{\\$([\\?\\!\\|@~])(\\w+)\\}/e',
>   "HttpVariables(\$pagename, PSS('$1'), PSS('$2'))");
> ===(snip)===
> I'm not familiar with having 2 rules like this in httpvariables...  In fact,
> the more I look at it (noting that the name is identical) I'm wondering if
> the 2nd doesn't overwrite the 1st?  

Actually, if more than one call to Markup() uses the name of an
existing rule, the 2nd and subsequent calls are ignored.

This allows config.php to specify a markup rule that overrides
one of PmWiki's built-ins (which are usually processed after
local customizations).

> That's a wild guess...  If that's the
> case then they both have their markup order specified as '>{$var}' and I
> don't know how pmwiki decides the order between the 2 -- probably something
> to do with when they are defined?

If two rules have the same order specification, then they may occur
in either order (i.e., the sequence for those two rules is undefined).

Hope this helps,


More information about the pmwiki-users mailing list