[pmwiki-users] Fwd: pagelist output problem

John Rankin john.rankin at affinity.co.nz
Sun Sep 28 19:38:45 CDT 2014

On 26/09/14 1:06 PM, John Rankin wrote:
> In pagelist.php, FmtPageList makes a call to Keep($out).
> When the PublishPDF recipe generates xml output from the wiki markup for
> a pagelist, it doesn't detect that $out is a block (it sees only the
> keep token), so wraps the pagelist output in an extra (incorrect)
> paragraph tag. I have got around this by creating a PrivateFmtPageList
> function, which calls FmtPageList, then checks to see if this returns a
> string starting with $KeepToken. If so, it adds '<:block>' to the start
> of the string, which suppresses the extra paragraph tag.
> On the other hand, pmwiki does this correctly, producing just a <div
> class='fpltemplate'>, with no extra <p> wrapper, so I think I am doing
> it wrong. My question is, how does pmwiki determine that
>     (:pagelist ... :)
> produces <div ...>...</div> and not <p><div ...>...</div></p>, when the
> <div> block is inside a Keep when block markup is evaluated? What do I
> need to do to get the same behaviour when generating xml? Is a
> PrivateFmtPageList function the best solution?
Found it: the code needs to redefine the $BlockPattern variable to 
specify the
xml block tags. The pmwiki Keep function checks $BlockPattern and inserts a
'B' indicator into the keep id, then a markup rule looks for the 'B' 
indicator and
inserts a '<:block>' indicator.

When I redefine $BlockPattern it just works.


John Rankin

More information about the pmwiki-users mailing list