Issue 155 in gwtwiki: Html to wiki for embedded unordered lists adds an additional list item

5 views
Skip to first unread message

gwt...@googlecode.com

unread,
Jan 28, 2014, 9:10:30 AM1/28/14
to bl...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 155 by oliver.e...@gmail.com: Html to wiki for embedded unordered
lists adds an additional list item
http://code.google.com/p/gwtwiki/issues/detail?id=155

What steps will reproduce the problem?
1. Use the wikipedia converter to convert html to wiki

HTML2WikiConverter converter = new HTML2WikiConverter();
ToWikipedia toWikipedia = new ToWikipedia();

String html = "<p>Some text:</p>\n"
+ "<ul>\n<li>Level One - 1\n<ul>\n<li>Level
two</li>\n</ul>\n</li>\n<li>Level One - 2</li>\n</ul>";

converter.setInputHTML(html);

String wiki = converter.toWiki(toWikipedia);


What is the expected output? What do you see instead?

Expected output:

Some text:


* Level One - 1
** Level two
* Level One - 2


Actual output:
Some text:


* Level One - 1
** Level two
*
* Level One - 2

The additional list item (single level deep) under level two causes a blank
list item to display when rendered back into html.

Repeating the process adds an additional li each time.


What version of the product are you using? On what operating system?

3.0.19, java 6, debian


Please provide any additional information below.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

gwt...@googlecode.com

unread,
Feb 25, 2014, 12:26:02 PM2/25/14
to bl...@googlegroups.com

Comment #1 on issue 155 by oliver.e...@gmail.com: Html to wiki for embedded
unordered lists adds an additional list item
http://code.google.com/p/gwtwiki/issues/detail?id=155

Chasing this one down further...

HtmlCleaner.createDocumentNodes() loops round the parent nodes, and on line
694, excludes content tokens that are equal to an empty string. It does not
recursively loop round the child nodes, so the ListTag.getListLines()
method includes the empty content nodes and adds the empty list item (line
72). I'm not sure what your preference is - make the document nodes
recursive, or add additional checks to the ListTag class. I haven't checked
other HtmlTag implementations to see if they would need similar checking.
Reply all
Reply to author
Forward
0 new messages