This one has been around for ages and is ''probably'' easy to fix. In
Parser.php the function openList does this:
if ( "*" == $char ) { $result .= "<ul><li>"; }
else if ( "#" == $char ) { $result .= "<ol><li>"; }
else if ( ":" == $char ) { $result .= "<dl><dd>"; }
In most cases, this works fine. Consider the following list structure, however
* item
*** 3rd-level item
** 2nd-level item
* (more items)
Lists with this general structure are quite common (although editors usually go through
some hoops to re-arrange them
because of the problem I'll outline in a moment). The HTML that results, however, has
issues:
<ul>
<li> item
<ul>
<LI>
<ul>
<li> 3rd-level item</li>
</ul>
<li> 2nd-level item
</ul>
<li> (more items)
</ul>
(Reformatted for clarity, and some leftover closing </li> tags omitted on the
grounds that they don't do any real harm.)
Notice that spurious <LI> in line 4 (which I capitalised here to make it easier to
see). It results in a very ugly display on the
user's screen, looking rather like this:
* list item
*
* 3-deep list item
* 2-deep item
* (more items)
Notice the gap and the spurious list marker. The desired display is this:
* list item
* 3-deep list item
* 2-deep item
* (more items)
How to fix it? I'm sure that someone with more skill than me could come up with a
comprehensive and elegant fix, but here is
a simple one on the brute-force level. Retain the basic:
if ( "*" == $char ) { $result .= "<ul><li>"; }
but reprocess it afterwards looking for the string "<li><ul>" and
replacing the string with just plain "<ul>". If I have this straight
in my mind, <li> should *never* directly precede <ul> in the output HTML.
Similar logic applies to the other two list types.
Tannin (Tony Wilson)