Page MenuHomePhabricator

Investigate and fix the behaviour of Language Converter around redlinks and self-links in Parsoid
Closed, ResolvedPublic

Description

Parsoid redlink/self-link pass is currently not doing anything special around language conversion for redlinks and self-links, and it probably should. To be done:

  • check how red/self links are handled in legacy parser, in particular in cases where the page might exist in other language variants, and document it if necessary
  • align Parsoid on that behaviour

Event Timeline

Three test articles:

From \ To[[Č]][[Budimpešta]][[Budimpešt]]
ЧBlue link to ČBlue link to Будимпешта, link text is BudimpeštaRed link to Budimpešt
БудимпештаBlue link to ČSelf-link, link text is BudimpeštaRed link to Budimpešt

So

  • If the given variant exists, link to that
  • If the given variant doesn’t exist, but another one does, link to the existing one
  • If no variant exists, link to the given variant

Red link and self-link detection runs after the above normalization, but the link text is determined before the normalization.

(I don’t know what happens if the given variant doesn’t exist, but multiple other variants do, as Serbian has only two variants, and I can’t read Chinese.)

Ah, brilliant, thank you very much!

I hope this Phase 5: (Later) doesn’t mean Parsoid read views will be enabled on wikis with language conversion (even in talk namespaces) before this is done.

T53587: Parsoid needs to run findVariantLink or some equivalent thing and T258856: Links to variants titles in Parsoid are still marked as red links are related and https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/738019 seems to fix this, although we ran into a glitch there which we are discussing.

I hope this Phase 5: (Later) doesn’t mean Parsoid read views will be enabled on wikis with language conversion (even in talk namespaces) before this is done.

Yes, we won't enable parsoid readviews on a lang-variant wiki without lang variant handling fixed everywhere it is broken in Parsoid.

ABreault-WMF triaged this task as Medium priority.

Change #1046763 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/services/parsoid@master] Add selflink classes to variant resolved links

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

Change #1046763 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Add selflink classes to variant resolved links

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

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

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.20.0-a11

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

Change #1051079 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.20.0-a11

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