Page MenuHomePhabricator

Link-in-link wikitext error resulted in duplicated content in a reply tool edit
Open, MediumPublic

Description

https://en.wikipedia.org/?diff=1084558271

This looks the same as T280050, which was fixed a year ago. There's also a vaguely related task T280603.

Event Timeline

This below demonstrates the problem

[subbu@earth:~/work/wmf/parsoid] echo "[http://foo.com [[Foo]]]" | php bin/parse.php
<p data-parsoid='{"dsr":[0,24,0,0]}'><a rel="mw:ExtLink" href="http://foo.com" class="external autonumber" data-parsoid='{"dsr":[0,24,16,1]}'></a><a rel="mw:WikiLink" href="./Foo" title="Foo" class="mw-redirect" data-parsoid='{"stx":"simple","a":{"href":"./Foo"},"sa":{"href":"Foo"},"dsr":[24,24,null,null],"misnested":true}'>Foo</a></p>

[subbu@earth:~/work/wmf/parsoid] echo "[http://foo.com ''[[Foo]]'']" | php bin/parse.php
<p data-parsoid='{"dsr":[0,28,0,0]}'><a rel="mw:ExtLink" href="http://foo.com" class="external text" data-parsoid='{"dsr":[0,28,16,1]}'><i data-parsoid='{"dsr":[16,27,2,2]}'></i></a><i data-parsoid='{"dsr":[16,27,2,2]}'><a rel="mw:WikiLink" href="./Foo" title="Foo" class="mw-redirect" data-parsoid='{"stx":"simple","a":{"href":"./Foo"},"sa":{"href":"Foo"},"dsr":[28,28,null,null],"misnested":true}'>Foo</a></i></p>

UnpackDOMFragments marks the broken content with 'misnested: true' properties but it isn't robust enough. So, need to update it to mark the outermost / all nodes of the subtree as misnested, not just the a-tag.

ssastry triaged this task as Medium priority.May 6 2022, 8:41 PM
ssastry added a subscriber: ihurbain.

A-ha - that explains things, possibly, probably - thanks for the heads-up!

Change 790422 had a related patch set uploaded (by Subramanya Sastry; author: Subramanya Sastry):

[mediawiki/services/parsoid@master] WIP: Make marking of misnested link-in-link content more robust

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

Change 790422 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Improve robustness of tagging misnested link-in-link content

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

I guess this should be resolved by the patch?

It is, but some of our phabricator processes on the team are changing a bit. For now, till this is deployed and verified working, let us leave this open.

Change 797372 had a related patch set uploaded (by Subramanya Sastry; author: Subramanya Sastry):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.16.0-a9

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

Change 797372 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.16.0-a9

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