[pmwiki-users] custom markup and unwanted <p> tags

DaveG pmwiki at solidgone.com
Mon May 18 08:17:03 CDT 2009

labellz wrote:
> Hi all,
> I need my sidebar to produce the following HTML:
> <ul id="expList">
>    <li id="navsubtop">Header
>    <ul>
>      <li id="navsub"><a href="page1.htm">Link 1</a></li>
>      <li id="navsub"><a href="page2.htm">Link 2</a></li>
>      <li id="navsub"><a href="page3.htm">Link 3</a></li>
>    </ul>
>    </li>
> </ul>

This produces the result you want:
* %list id=expList% %item id=navsubtop%Header
** %item id=navsub%link1
** %item id=navsub%link2
** %item id=navsub%link3

> I have the following custom markup in config.php:
> Markup("expstart",'inline',"/\\(:expstart:\\)/","<ul id='expList'>");
> Markup("exphead",'inline',"/\\(:exphead:\\)/","<li id='navsubtop'>");
> Markup("expitem1",'inline',"/\\(:expitem1:\\)/","<ul>");
> Markup("expitem",'inline',"/\\(:expitem:\\)/","<li id='navsub'>");
> Markup("expitemend",'inline',"/\\(:expitemend:\\)/","</li>");
> Markup("expend",'inline',"/\\(:expend:\\)/","</ul></li></ul>");
> The markup itself seems okay.
> The problem is that it produces the following html source:
It's unclear from the example why you are introducing new markup, but it 
in this case it's certainly an extra un-needed overhead.

>    <ul id='expList'>
> <p><li id='navsubtop'>
> </p><ul>
> <p><li id='navsub'><a href="page1.htm">Link 1</a></li>
> <li id='navsub'><a href="page2.htm">Link 2</a></li>
> <li id='navsub'><a href="page3.htm">Link 3</a></li>
> </p></ul></li></ul>
> Why oh why oh why oh why??  Those <p> </p> tags inside the <ul> are killing me.
I agree, but again in this case it's your markup that is likely the 
cause, probably due to line breaks in the markup.

> What criteria does pmwiki use to decide which custom markup bits get wrapped in <p> 
> tags and which don't?  Any way I can control it?
I wish I could tell you, but I can only agree in commenting that it can 
be pretty frustrating at times. :)

More information about the pmwiki-users mailing list