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.
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