PHP Classes

Ordered lists not neting correctly

Recommend this page to a friend!

      Wiki Parser  >  All threads  >  Ordered lists not neting correctly  >  (Un) Subscribe thread alerts  
Subject:Ordered lists not neting correctly
Summary:Parser not generating correct xhtml
Messages:1
Author:Joaquín Windmüller
Date:2006-07-29 01:59:03
 

  1. Ordered lists not neting correctly   Reply   Report abuse  
Picture of Joaquín Windmüller Joaquín Windmüller - 2006-07-29 01:59:03
I'm using this class to parse text like this:

#item 1
#item 2
##item 2.1
##item 2.2
##item 2.3
#item 3

An its generating incorrect html like this:

<ol>
<li>item 1</li>
<li>item 2</li>

<ol>
<li>item 2.1</li>
<li>item 2.2</li>
<li>item 2.3</li>

</ol>
<li>item 3</li>

It should be:

<ol>
<li>item 1</li>
<li>item 2

<ol>
<li>item 2.1</li>
<li>item 2.2</li>
<li>item 2.3</li>

</ol>
</li>
<li>item 3</li>
</ol>

The <ol> aren't being nested correctly and the last </ol> is never printed