From: Tara S. <te...@cl...> - 2001-11-15 11:52:27
|
I can't find my way in the code to do this, but this is how nested lists=20 could be made standards-compliant. First, this is what a nested list should look like (hope you can see the=20 tags): <ul> <li>first</li> <li>second <ul> <li>first nested</li> <li>second nested</li> </ul></li> <li>third</li> <li>last</li> </ul> you can see that the inner <ul> simply needs to be inserted inside an=20 existing (closed) list item. One way to do this would be (it's probably similar to some extent to=20 what is currently being done in 1.3): On meeting the first * (or #), replace it with <ul><li>. Replace the next * by </li>\n</li> (etc) If we get two ** replace by <ul><li> (you can see that it is the same as=20 the first, so no need to treat it differently) So basically, we need two "opening" lines: one of the "first" or "extra" * (if there is one more than the last=20 line, of if this is the first line) one for a "next" ** in a series. The tricky part is the closing. When we go "down" one level, we need to have: </li></ul></li> (closing the nested list-item, closing the nested list,=20 closing the list-item the nested list is in. But if we're going down to level zero, we need: <li></ul> I think there is some sort of counter in the current code that keeps=20 track of which level we are in? There. I'm just posting this thinking to the list in case it can inspire=20 someone. If you see clearer than me into the existing code (which isn't=20 difficult), is there a simple way this could be implemented in it? I'm sure I could hack out a little function or such to do this, but it=20 would probably take me a VERY long time and be VERY ugly ;) waiting for feedback :) Tara --=20 Je r=E9ponds au mieux de mes connaissances Climb to the Stars! - http://climbtothestars.org/ SpiroLattic - http://climbtothestars.org/spiro/ Pompeurs Associ=E9s - http://pompage.net/ |