[pmwiki-users] quirk with nested-if
Patrick R. Michaud
pmichaud at pobox.com
Mon Jun 30 09:33:33 CDT 2008
On Mon, Jun 30, 2008 at 01:44:41PM +0200, Peter Bowers wrote:
> > yes. GroupHeader and GroupFooter pages are included with standard
> > (:include ..:) markup, and (:include ..:) directives are rendered
> > after (:if..:) directives (Markup('include', '>if', ... in
> > stdmarkup.php).
> > Conditional (:if ...:) markup does work in GroupHeader and GroupFooter
> > pages, BTW.
> How does this work? It's exactly what I found in my testing, but it
> seems strange. If (:if:) gets processed *before* (:include:) then how
> come the (:if ...:) within those included pages gets rendered? It
> seems that the (:if:) directive in the included text wouldn't even
> exist until after the if rule had already been executed...
> I'm not arguing that it happens - I verify that you are exactly
> correct on my own system. I'm just confused *how* it happens...
Whenever an (:include:) directive is processed, PmWiki restarts
processing of the new text using the entire rule set. This way
any directives or markups inside of the included file are also
(For the programming minded-- the PRR() function ("PmWiki restart ruleset")
is the one that signals PmWiki to restart rule processing at the beginning.
More information about the pmwiki-users