[pmwiki-users] Newlines in list item HTML output

Patrick R. Michaud pmichaud at pobox.com
Mon Aug 14 18:37:14 CDT 2006

On Mon, Aug 14, 2006 at 05:41:43PM -0400, Ryan R. Varick wrote:
> Just a quick question about the way PmWiki generates list markup.  The
> following wiki markup:
> * Item 1
> * Item 2
> * Item 3
> Will generate the following HTML:
> <ul><li>Item 1
> </li><li>Item 2
> </li><li>Item 3
> </li></ul>
> Why is the newline placed before the closing list item tag?  

It's just an artifact of how PmWiki chooses to generate markup.
In particular, PmWiki outputs a newline corresponding to each
input line of markup (to make it easier to debug, also helps
with preformatted text blocks), and we can't know to generate
the closing </li> until we actually read the next line of

> More importantly, is it possible to place the newline *after* the closing
> tag?

Not easily, because it requires looking ahead to the next line
of markup to know what to do.  I might be able to eliminate the 
newlines after certain tags, however.


More information about the pmwiki-users mailing list