Page MenuHomePhabricator

Parsoid redirects are not parsed as proper links
Closed, ResolvedPublic

Description

Redirects to language links and interwiki links in Parsoid are not quite treated the same as Parsoid. For example:

#REDIRECT [[meatball:Foo]]
#REDIRECT [[en:English language]]

Currently Parsoid treats these both as local links (to an article named meatball:Foo in the first case, and an article named en:English language in the second). The PHP parser treats the first as a proper link, resolving the interwiki reference, but does not automatically follow it (since it would leave the local wiki). The PHP parser treats the second an a redirect to an article named en:English language, which is the same as Parsoid's behavior, but seems like a bug.

I propose that Parsoid should delegate to its normal link handling code for both of these cases, rather than confusingly partially-duplicating link handling, and emit a <link rel="mw:PageProp/redirect" href="...."> element giving the properly resolved href in both cases. It is up to the client to avoid emitting a 301/302 redirect to a non-local href when it encounters a <link rel="mw:PageProp/redirect"> in the Parsoid document.

Event Timeline

cscott raised the priority of this task from to Medium.
cscott updated the task description. (Show Details)
cscott added a project: Parsoid.
cscott subscribed.

Change 222323 had a related patch set uploaded (by Cscott):
T104918: Fix redirects to non-local targets.

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

Change 222323 merged by jenkins-bot:
T104918: Fix redirects to non-local targets.

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

cscott claimed this task.

Filed T106567 to make the PHP parser consistent with Parsoid in the language link corner case.