Page MenuHomePhabricator

Multiline list items rendering differently in ContentEditable than the resulting wikitext
Closed, DuplicatePublic

Description

This is an interesting issue that, as far as I understand, can be either (or both) VE and Parsoid, and seems to be limited by wikitext.

I'm not entirely sure what the strategy here should be -- If the final article markup is "the way things are supposed to be" then the fix should be to correct the way things look to the user in ContentEditable so they match the final article display.

However, there might be a creative way to manipulate the wikitext in Parsoid (or the html VE sends to Parsoid) so that the end result fits what VisualEditor presents.

The first solution will disallow multiline list items. The second solution would run the risk of having html tags in wikitext, or worse, having the dreaded dirty diffs if the desired multiline list item is more complex.

Here's how to see the issue:
(Refer to this image: http://mg.viewskew.com/mgoblin_media/media_entries/432/ve_listbug.png )

  1. Edit some wiki page (can be empty/new)
  2. Type 3-4 lines
  3. Mark the lines and make them a list with the list button
  4. Go to the second element (or whatever one that is in the middle of the list)
  5. Go to the end of that listItem's line, and hit "Shift-Enter"
  6. In VisualEditor, the behavior is similar to other word processors with multiline list element -- you get a second line that is indented the same as the list item you're under.
  7. Type something so you have text on that multiline segment. (#1 in the image)
  8. Click 'save' and review changes; wikitext is not representing what we see on the screen (see #2 in the image)
  9. Save the article -- the article presents a different format than what VE showed (#3 in the image) and presents a different content to edit if we want to edit that article again (#4 in the image)

The way I see it (and I may well be wrong, as I'm not that familiar with wikitext) -- we can either fix this bug so VE presents the same display as the final article (as in, disallow shift-enter in lists) or we need to split multiline items into paragraphs that can render as such into wikitext (not sure if that's possible) -- the other alternative is to force a <br /> on multiline lists, which would make the wikitext into something like

  • item 1
  • item 2
  • item 3<br />and its multiline
  • item 4

And that works perfectly in the article and in edit mode -- but it can be limited in what can be done inside a multiline list item, and requires the use of <br /> tag inside the wikitext.

Also, there may be more cases of complex list items with VE's expanding features. For instance, there can be cases where a multiline list item should contain a certain language block, or a short code highlight segment, or a <math> block. Right now they render proplery in CE if added as multiline list item, but break the list and become separate paragraph items on save.


Version: unspecified
Severity: normal

Details

Reference
bz55746

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:36 AM
bzimport set Reference to bz55746.
Jdforrester-WMF set Security to None.
Jdforrester-WMF moved this task from To Triage to Freezer on the VisualEditor board.

The link to the image is dead now. Is this the same issue as T70800?

The link to the image is dead now. Is this the same issue as T70800?

According to the reproduction steps, this seems rather the same issue as T110986.

I’m not sure about set child task.

Duplicate of T110986. This one is older, but the other has more discussion on it (sorry @Mooeypoo)