Page MenuHomePhabricator

Extended annotation ranges sometimes duplicate the closing tag when round-tripping with edits
Closed, ResolvedPublicBUG REPORT

Description

When an annotation range gets extended around a list, adding a bullet point at the end of that list creates a second </translate> tag, which then breaks the VisualEditor workflow (since the tags are not well balanced anymore).

This is reproduced by the following test case:

!! test
Extended annotation marker should not get duplicated
!! options
parsoid={
        "modes": ["selser"],
        "changes": [
                ["li", "after", "<li>Second item</li>"]
        ]
}
!! wikitext
<translate>
* First item</translate>
!! wikitext/edited
<translate>
* First item
* Second item
</translate>
!! end

which renders instead

<translate>
* First item</translate>
* Second item
</translate>

Related Objects

StatusSubtypeAssignedTask
OpenReleaseNone
OpenNone
OpenNone
OpenNone
OpenFeatureNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedEsanders
OpenFeatureNone
Resolvedihurbain
Resolvedihurbain
ResolvedBUG REPORTihurbain

Event Timeline

Arlolra triaged this task as Medium priority.Jan 6 2022, 12:04 AM
Arlolra moved this task from Needs Triage to Bugs & Crashers on the Parsoid board.

Change 760914 had a related patch set uploaded (by Isabelle Hurbain-Palatin; author: Isabelle Hurbain-Palatin):

[mediawiki/services/parsoid@master] Fix annotation range detection interactions with selser

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

Test wiki created on Patch demo by IHurbainPalatin (WMF) using patch(es) linked to this task:

https://patchdemo.wmflabs.org/wikis/433d1f5f9f/w/

Test wiki on Patch demo by IHurbainPalatin (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/433d1f5f9f/w/

Change 760914 abandoned by Isabelle Hurbain-Palatin:

[mediawiki/services/parsoid@master] Fix duplication of extended annotation range tags

Reason:

We're going with the solution of making these ranges uneditable instead (769071)

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