[pmwiki-users] Too much tags

Patrick R. Michaud pmichaud at pobox.com
Thu Aug 4 08:30:03 CDT 2005

On Thu, Aug 04, 2005 at 10:21:15AM +0200, stephane.smets at banksys.be wrote:
>    I convert actually a website to Pmwiki, and I find some strangenesses into
>    the HTML generated by PMWiki.
>    </p><p class='vspace'></p>
>    <p><form name="onetime">
>    </p>
>    As you can see, there is several  <p class='vspace'></p> without any text
>    on it so these tags are not needed, and create some spaces into the
>    output.

They are needed -- these are the tags that generate vertical space
in the output.  For a variety of reasons, PmWiki changes the setting of
a plain <p> tag to not produce any vertical margin.

>    More, there is a <p> followed by a <form> then a </p> which is not
>    correct.
>    I use for this page the Cookbook "HTML enable" because I paste the <form>
>    code (this page contains also javascript) from the original website.

PmWiki wants to put paragraph tags around anything it sees that looks
like plain text, and the EnableHTML recipe encapsulates the <form> markup
with Keep() such that PmWiki can't see that there's a block there.  
So, it places the <p>...</p> around the tag, thinking it's text.

One solution would be to fix EnableHTML so that it doesn't encapsulate
the entire tag.  Try the following version of EnableHTML instead:

    function EnableHtml($tag) {
        "'<$1 '.Keep(PSS('$3')).'>'");

I have this in place at http://www.pmwiki.org/wiki/Test/EnableHTML,
you can see the resulting markup around the <form> tags.  There's
a bug in beta54 that causes PmWiki to still put <p>...</p> around
the closing </form> tag, but I now have that fixed for the next release.


More information about the pmwiki-users mailing list