[pmwiki-users] Fwd: pagelist output problem

John Rankin john.rankin at affinity.co.nz
Thu Sep 25 20:06:14 CDT 2014

I sent this to pmwiki-devel yesterday. It doesn't seem to have come 
through, so I am re-posting to pmwiki-users.

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?

I'm running pmwiki 2.2.63. In the past, pagelist added the <div> *after*
the Keep call, so a simple "look for <div" rule solved the problem.

Hope this makes sense. Any advice will be greatly appreciated. I can
provide links to an example if it will help.


John Rankin

More information about the pmwiki-users mailing list