Last modified: 2014-02-28 23:05:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T57746, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 55746 - Multiline list items rendering differently in ContentEditable than the resulting wikitext
Multiline list items rendering differently in ContentEditable than the result...
Status: NEW
Product: VisualEditor
Classification: Unclassified
ContentEditable (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Editing team bugs – take if you're interested!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-15 16:25 UTC by Moriel Schottlender
Modified: 2014-02-28 23:05 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Moriel Schottlender 2013-10-15 16:25:47 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links