Page MenuHomePhabricator

Bad handling of annotations in which the end tag is fostered
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

In a wiki that has the Translate extension installed, create a page with the following wikitext

<table>
<tr>
<td><translate>some stuff</td>
</tr>
<div></translate></div>
<tr><td>hello</td></tr>
</table>

Open the page with VisualEditor.

What happens?:

The meta tag corresponding to </translate> moves before the one corresponding to the <translate> tag (because its parent div is fostered) and the annotation range is not valid.

This may have an impact on larger pages with multiple <translate> ranges, because there's assumptions that this does not happen.

What should have happened instead?:

The meta tag corresponding to </translate> should be moved to after the table; the annotation range should be extended to the whole table and the table should be marked as uneditable in VisualEditor to prevent round-trip issues leading to bad markup/corruption.

Note
This is an annotation issue, it doesn't have much to do with Translate - but since Translate is the only extension providing annotations, that's the one we use to reproduce the issue.

Event Timeline

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

[mediawiki/services/parsoid@master] [WIP] putting fostered end annotation markers after the table

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

Change 960104 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Putting fostered end annotation markers after the table

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

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

[mediawiki/services/parsoid@master] Include fostered annotation tags in fostered transclusions

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

Change 962706 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.18.0-a26

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

Change 962706 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.18.0-a26

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

Change 962633 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Include fostered annotation tags in fostered transclusions

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

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

[mediawiki/services/parsoid@master] Remove tbody tags from new annotation parser tests

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

Change 964549 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Remove tbody tags from new annotation parser tests

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

Change 964566 had a related patch set uploaded (by Jgiannelos; author: Jgiannelos):

[mediawiki/vendor@master] Bump wikimedia/parsoid to v0.18.0-a28

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

Change 964566 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to v0.18.0-a28

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