Page MenuHomePhabricator

Bug converting nested lists to wikitext
Open, MediumPublic

Description

[subbu@earth html2wt] echo '<ul><li>a<ul><li>b</li></ul></li></ul>' | parse.js --html2wt
* a
** b

[subbu@earth html2wt] echo '<ul><li>a</li><ul><li>b</li></ul></ul>' | parse.js --html2wt
* a
* b

[subbu@earth html2wt] echo '<ul><li>a</li><li><ul><li>b</li></ul></li></ul>' | parse.js --html2wt
* a
** b

The first snippet is the HTML that the mediawiki parser generates (and that Parsoid also reproduces). However, the former HTML is cleaner and better. We cannot change our HTML to that form since I imagine CSS and JS code that depend on this structure would need to be fixed up.

However, we should accept that HTML in the second form and properly serialize it to the nested list wikitext form (like we do with the 3rd form). This will help converting etherpad HTML to wikitext.