Page MenuHomePhabricator

Extra white space added when editing around links in tables (selser issue?)
Open, Needs TriagePublic

Description

When adding a reference directly after a link in a table cell, upon saving changes (or previewing wikitext) an extra space appears between the link and a reference. The issue doesn't occur with red links (links to non-existent pages), only normal wiki links.

Example: https://pl.wikipedia.org/w/index.php?title=Puchar_Świata_Siłaczy_2004%3A_Edmonton&diff=prev&oldid=69733804

It kind of looks like the space after ]] and before | is being "attached" to the link, rather than the table cell, causing the <ref> to be added in the wrong place. And because this doesn't affect red links, which bypass the selective serialization mechanism (as we recently discovered, see https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/891591), I'm thinking it's a problem with selser.

Originally reported here: https://pl.wikipedia.org/wiki/Wikipedia:Kawiarenka/Kwestie_techniczne#c-MarMi_wiki-20230227120800-Malarz_pl-20230221190300

Event Timeline

Can be reproduced consistently: https://en.wikipedia.beta.wmflabs.org/w/index.php?title=T330679&diff=prev&oldid=575388

I copy-pasted the reference in the same way in every cell, but in the second row (containing blue links), both cells with trailing spaces in the wikitext gained a visible space character. The row without links and row with red links did not (but the non-semantic space character disappeared).

Bug is still present on beta, but seemingly unrelated to redlinks, this time showing spaces after links for a/b but not c: https://en.wikipedia.beta.wmflabs.org/w/index.php?title=T330679&diff=603564&oldid=603563