Page MenuHomePhabricator

VisualEditor: If you insert a gallery into a list, the list formatting remains visible but is removed in wikitext
Open, LowPublic

Description

Intention:
Add an image gallery at the top of a section.

Steps to Reproduce:

  1. Open a page that has a list at the top of the section.
  1. Place your cursor at the top of the list, and Insert > Gallery.

Actual Results:
The bullet remains visible. The text of the list item is on the next line, but indented.

However, when you save, the list formatting (the asterisk at the start of the line) has been removed.

Expected Results:
The gallery would be inserted before the list. That is,

  • List item

would turn into

<gallery>File:Example.jpg
File:Example2.jpg</gallery>

* List item

instead of into

 <gallery>File:Example.jpg
File:Example2.jpg</gallery>List item

(Notice the stray space at the start of the line.)

Reproducible: Always


Version: unspecified
Severity: normal
URL: http://en.wikipedia.beta.wmflabs.org/w/index.php?diff=92775&oldid=92716

Details

Reference
bz65022

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:08 AM
bzimport added a project: VisualEditor.
bzimport set Reference to bz65022.

This sort of happens if you insert a references list, which gives you this:

<references />List item

but not for images, math, templates, etc.

Jdforrester-WMF changed the task status from Open to Stalled.Feb 2 2015, 7:24 PM
Deskana changed the task status from Stalled to Open.Jul 31 2018, 6:42 PM
Deskana triaged this task as Low priority.
Deskana moved this task from To Triage to Freezer on the VisualEditor board.
Pols12 subscribed.

Unlike legacy parser which breaks the list (T11996), Parsoid well supports <gallery> inside list item: wikitext-to-html seems to work correctly.
However, this bug seems to indicate there is an issue with html-to-wiktext, since VisualEditor rendering is correct:

<li id="mwBQ" class="ve-ce-branchNode">
  <div class="ve-ce-branchNode-slug ve-ce-branchNode-blockSlug"></div>
  <ul class="ve-ce-branchNode gallery ve-ce-focusableNode">
    <li class="ve-ce-branchNode gallerybox">
      <div class="thumb" style="width: 150px; height: 150px;"></div>
      <a href="#" class="oo-ui-element-hidden"></a>
      <div class="ve-ce-branchNode ve-ce-activeNode gallerytext"></div>
    </li>
  </ul>
  <p class="ve-ce-branchNode ve-ce-contentBranchNode ve-ce-paragraphNode ve-ce-generated-wrapper">List item</p>
</li>

which should be parsed as

* <gallery>
…
</gallery> List item