Page MenuHomePhabricator

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


  1. Create a gallery caption with <small> text:
  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

<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="" /></a>
        <div class="gallerytext"><small id="mwCQ">Small caption MODIFIED</small></div>

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

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

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

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

Change 738988 merged by jenkins-bot:

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

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.