Page MenuHomePhabricator

<small> gallery caption can't be edited
Closed, ResolvedPublic

Description

  1. Create a gallery caption with <small> text: https://www.mediawiki.org/wiki/User:ESanders_(WMF)/sandbox/gallery
  2. Try to append some text to the caption in the gallery dialog
  3. In the save dialog, preview your changes, observe the text you added is not there

Event Timeline

After editing the caption I get the following HTML from VE (using ve.init.target.surface.getHtml())

<ul typeof="mw:Extension/gallery" data-mw='{"name":"gallery","attrs":{},"body":{}}' class="gallery mw-gallery-traditional" about="#mwt2" id="mwAg">
    <li class="gallerybox">
        <div class="thumb">
            <span typeof="mw:Image">
                <a><img resource="./File:VisualEditor-logo.svg" src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/12/VisualEditor-logo.svg/200px-VisualEditor-logo.svg.png" /></a>
            </span>
        </div>
        <div class="gallerytext"><small id="mwCQ">Small caption MODIFIED</small></div>
    </li>
</ul>

Which converts to the correct wikitext in a standalone instance of Parsoid. This leads me to believe this must be a problem with restbase IDs / data-parsoid.

If I remove then re-add the <small> styling in the editor, I get a new HTML element in the output, without id="mwCQ" and the bug goes away, so this is definitely a Parsoid issue.

Yeah, the dom diff'er doesn't traverse into the gallery content so the presence of an id without diff markers indicates that source can be reused and the modification is dropped. We have T214648 and T214651 which captures this already

Change 735081 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/services/parsoid@master] [WIP] DOM diff galleries

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

Let's keep this task open as it more clearly describes the user problem from the Editing team's perspective. It will be easier for our QA to verify.

Change 735081 merged by jenkins-bot:

[mediawiki/services/parsoid@master] DOM diff galleries

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

Change 738988 had a related patch set uploaded (by Sbailey; author: Sbailey):

[mediawiki/vendor@master] Bump Parsoid to 0.15.0-a10

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

Change 738988 merged by jenkins-bot:

[mediawiki/vendor@master] Bump Parsoid to 0.15.0-a10

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

We''re good on this now. I also tried saving, just to be sure. What you see is actually what you get.
For reference:

Screenshot 2021-11-17 at 16.43.25.png (536×824 px, 23 KB)

The bug is about appending text to an existing <small> caption, which now LGTM:

image.png (348×897 px, 33 KB)

ppelberg claimed this task.