Page MenuHomePhabricator

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

Description

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

Attached:

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

Details

Reference
bz50483

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
#foo
#bar

Can you provide the HTML the VE sends?

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

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
#Foo##Bar

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
#Foo

Bar

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

https://gerrit.wikimedia.org/r/71395

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

https://gerrit.wikimedia.org/r/71395