bryonjacob / wikimodel

Automatically exported from code.google.com/p/wikimodel
0 stars 0 forks source link

XHtmlParser - iWemListener not called for nested lists #14

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I attempt to parse the following html with the XhtmlParser:
<ul>
  <li>item a</li>
  <li>item b</li>
  <li>item c</li>
  <ul>
      <li>item c.a</li>
  </ul>
</ul>

I would expect the listener calls to be something like:
beginList();
beginListItem(); endListItem();
beginListItem(); endListItem();
beginListItem(); endListItem();
beginList(); // start of nested list
beginListItem(); endListItem();
endList();   // end of nested list
endList();

I do not see the nested beginList() and endList() calls.  I do not know if
this problem is isolated to the XhtmlParser, or if it is more of a general
problem with the way wem handles nested lists.  

Once I get the updated jars (either built or sent to me) that include fixes
for handling the Creole markup for nested lists, I can test nesting from
that direction.  For example in Creole, the above list should be:

* item a
* item b
* item c
** item c.a

Original issue reported on code.google.com by dannylev...@gmail.com on 9 Jan 2008 at 4:22

GoogleCodeExporter commented 8 years ago
This sequence is invalid:
{{{
<ul>
  <li>item a</li>
  <li>item b</li>
  <li>item c</li>
  <ul>                  <-- Embedded list has to be *in* the "item c"!!!
      <li>item c.a</li>
  </ul>
</ul>
}}}

Normally this sequence should be translated in *two* undependend lists:
{{{
- item a
- item b
- item c

- item c.a
}}}

The problem is that embedded lists have to be *in* the list item (see XHTML
specification):
{{{
<ul>
  <li>item a</li>
  <li>item b</li>
  <li>item c
     <ul>
        <li>item c.a</li>
     </ul>
  </li>
</ul>
}}}
Such a sequence should be recognized as embedded lists. If these tags are not
recognized as embedded lists then it should be considered as a bug of the WEM 
XHTML
translator.

To generate valid XHTML from eventually invalid HTML it is possible to use HTML
cleanters like CyberNeko (http://sourceforge.net/projects/nekohtml) or JTidy.

Original comment by mikhail....@gmail.com on 10 Jan 2008 at 3:30

GoogleCodeExporter commented 8 years ago

Original comment by mikhail....@gmail.com on 10 Jan 2008 at 3:37

GoogleCodeExporter commented 8 years ago
I consider the current behaviour as correct - it generates embedded lists 
respecting
the XHTML spec (embedded lists are in parent list items). 

Original comment by mikhail....@gmail.com on 15 Jun 2008 at 10:58