[pmwiki-users] Markup() in a Markup() call, or conditionally loading a recipe

Peter Bowers pbowers at pobox.com
Mon Feb 9 15:08:24 CST 2009


On Mon, Feb 9, 2009 at 7:00 PM, Scott Diegel <scottdiegel at gmail.com> wrote:

> I've managed to get the result I want by editing the return value of
> MkSopNumTitle based on whether or not "(:sop:)" was found.  I still think it
> seems reasonable to allow "Markup()" in a "Markup()".
>

Glad you got it working.

Note that the markup rules in pmwiki are the inner DNA structure of the
whole system and thus have to be set up "just right" for the system to
work.  And the order of them is hugely (!) important.  I'm not too surprised
that inserting a markup late (during page processing) doesn't take effect.
I looked into manipulating things via BuildMarkupRules() or incrementing
$RedoMarkupLine but unfortunately (or perhaps fortunately?) $markrules is
local to MarkupToHTML() and so inaccessible for this type of manipulating.
(It would have been an ugly hack anyways...)

If you really wanted to do said ugly hack and were willing to edit your
pmwiki.php (something that is strongly recommended against for very good
reasons) you could make $markrules a global in MarkupToHTML() -- that's the
change in pmwiki.php.  Then in your SopHeader() function you would call your
Markup() and then say "$markrules = BuildMarkupRules();" and then increment
$RedoMarkupLine.  (Obviously making sure that $markrules and $RedoMarkupLine
are globals.)

I'll close now so 10 people can post explaining why that's a really bad
idea.  It really is a bad idea to alter pmwiki.php.  You shouldn't do it.  I
didn't do it even to test the dirty hack.  So probably even if you did do it
it wouldn't work.  That's how bad an idea it is... :-)

-Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20090209/2bac2288/attachment.html 


More information about the pmwiki-users mailing list