[pmwiki-users] Input recipe: Entering alpha test

Christian Schlatter ch at schlatter.net
Mon Jun 27 13:03:19 CDT 2005


Joachim Durchholz wrote:
> The markups (:input start...:) and (:input end:) have been tested and 
> confirmed to emit the HTML that they should. PmWiki wraps them in 
> paragraph tags; I dimly recall this can be prevented by generating that 
> as "block markup", but I don't know how. (What I need is "make it a 
> block markup and stuff it into Keep()". I'm grateful for any hints, 
> since I don't have the time to dig it up myself. Right now, this means 
> that the recipe will generate invalid HTML that works fine on Mozilla *g*.)

I extracted the following from an earlier email:

> The problem is that PmWiki doesn't have any easy way to know that
> the Keep() result contains block markup.  The easy way to fix this
> is probably to do:
> 
>    Markup("gallery", "directive",
>      "/^\\(:gallery:\\)/e",
>      "'<:block>'.Keep(cs_gallery())");
> 
> where the '<:block>' tells PmWiki that the item that follows isn't
> paragraph text.  Note that this restricts (:gallery:) to appearing
> at the beginning of a markup line.
> 
> Another way to do this (without restriction to beginning of line) may be to move the <div> generated by cs_gallery outside of the Keep(), as in:
> 
>    Markup("gallery", "directive",
>      "/\\(:gallery:\\)/e",
>      "'<div id=\"gallery\">'.Keep(cs_gallery()).'</div>'");
> 
> PmWiki will then see the <div> and know to not treat it as a
> paragraph.  (I've thought about trying to make the block
> markup smart enough to "look inside" of Keep() text for block
> markupsi to prevent paragraph formatting, but that's a *lot* more difficult than what I have now.

-ChristianS




More information about the pmwiki-users mailing list