From: Chuck E. <ec...@mi...> - 2001-04-27 18:30:11
|
At 01:20 PM 4/27/2001 -0500, Ian Bicking wrote: >I've done it so that certain tags can't nest inside each other. So if ><li> ... <li> is encountered, the parser sees that the enclosing tag >would be <li>, and then ends that tag and starts a new <li> over. >Ditto with <p>, <th>, and <dt> -- maybe there's others. Then all tags >end implicitly if their enclosing tag ends, so that <ol> <li> </ol> >will close <li>. > >In an earlier version with a more monolithic parser, I had <li> look >back for previous unclosed <li> elements, until it found <ol> or ><ul>. This way <li> would implicitly end any dangling tags... in >particular: > ><ol> > <li> Some text. <p> > Another paragraph > <li> Some more text. ></ol> What about the idea I describe in HTMLTag? For various tags like <p> you could specify "abrupt terminators" such as p, li, table, etc. This wouldn't require structural changes to HTMLTag. It would be tedious to create the specification of abrupt terminators, but once created, that should take care of most cases. HTMLTag would still barf on unbalanced tags, but I think that's OK. -Chuck |