Page MenuHomePhabricator

VisualEditor: Likely invalid HTML emitted for list items
Closed, ResolvedPublic


Screenshot of list indent problem

If I add indent to any list item, it breaks.

The indented line gets moved to the end of the previous line.

The live-changes looks as it is working properly, but the edit-diff (preview your changes) always shows it as broken. (See attachment)

Confirmed with:

  • Firefox and Chrome,
  • with ordered and un-ordered list items,
  • with items added to the middle of a list, and to the end of a list,
  • and with both new items added to a list, and existing items given increased indent.

Version: unspecified
Severity: major


Screenshot_of_list_indent_problem.png (747×884 px, 31 KB)



Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:55 AM
bzimport set Reference to bz50483.

This appears to be a (new?) bug in Parsoid -

  1. Foo
  2. Bar


Foo## Bar

rather than

  1. Foo
    1. Bar

Unless we're breaking something in VisualEditor somehow?

Cannot reproduce:

echo -e '#foo\n#bar' | node parse --wt2wt

Can you provide the HTML the VE sends?

echo '<ol><li>foo</li><li>bar</li></ol>' | node parse --html2wt

I'm guessing that VE emits the wrong HTML here, so reassigning to VE. Please move to Parsoid again if the VE HTML is sane.

$ echo '<ol><li>Foo<ol><li>Bar</li></ol></li></ol>' | node js/tests/parse.js --html2wt

Looks like Parsoid serializer is newline sensitive in this case:

$ echo '<ol><li>Foo\n<ol><li>Bar</li></ol></li></ol>' | node parse.js --html2wt


This is not a new bug. This has been around for a long time. I went back to commits almost 3 months back and tested.

Change 71395 had a related patch set uploaded by GWicke:
Bug 50483: Make sure nested list serialization is newline-insensitive

Change 71395 merged by jenkins-bot:
Bug 50483: Make sure nested list serialization is newline-insensitive