Page MenuHomePhabricator

Parsoid uses the wikipedia interwiki prefix for english wikipedia instead of the :en interwiki prefix
Closed, ResolvedPublic

Event Timeline

Sunpriat2 created this task.Oct 9 2017, 4:40 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 9 2017, 4:40 PM
Deskana triaged this task as Low priority.Oct 10 2017, 6:55 PM
Deskana added a subscriber: Deskana.

Please give detailed reproduction steps next time. It took me quite a while to figure out how to reproduce the problem, and I very nearly stopped before I realised what it was you were trying to say.

Steps to reproduce:

  1. Open the visual editor on a page.
  2. Copy the wikitext [[:en:Robert Gellately|Robert Gellately]] to your clipboard.
  3. Paste it in to the visual editor.

The wikitext that is produced when you do this is [[wikipedia:Robert Gellately|Robert Gellately]], which is not exactly what you'd expect. On the other hand, this wikitext is completely equivalent in functionality to the wikitext that was pasted in.

Deskana moved this task from To Triage to Freezer on the VisualEditor board.Oct 10 2017, 7:00 PM
  1. open
  2. edit in normal editor, copy paste
aaa <ref name="p. 65">[[:en:Robert Gellately|Robert Gellately]]. ''[ Lenin, Stalin, and Hitler: The Age of Social Catastrophe]'' [[:en:Knopf|Knopf]], 2007 ISBN 1-4000-4005-1 [ p. 65.]</ref> bbb ccc


  1. open edit in visual editor

as in diff just add the text "ссс"
publish, review or publish, publish
and you see changes in "[[wikipedia:Robert Gellately|Robert Gellately]]" which you did not touch at all

Sunpriat2 raised the priority of this task from Low to Needs Triage.Oct 11 2017, 7:15 AM

This is a Parsoid problem.

[subbu@earth parsoid] echo '<a href="" rel="mw:ExtLink" title="en:Robert Gellately">Robert Gellately</a>' | parse.js --html2wt --prefix itwiki
[[wikipedia:Robert Gellately|Robert Gellately]]
ssastry renamed this task from Interwiki with a colon inside ref tag are replaced by "wikipedia" to Parsoid uses the wikipedia interwiki prefix for english wikipedia instead of the :en interwiki prefix.Oct 11 2017, 10:43 PM
ssastry triaged this task as Medium priority.
ssastry edited projects, added Parsoid, Parsoid-Serializer; removed VisualEditor.
ssastry added a subscriber: cscott.

With the english wikipedia, this is generating the wrong link (as reported on IRC by @cscott )

[subbu@earth parsoid] echo '<a href="" rel="mw:ExtLink" title="Hospet">Hospet</a>' | parse.js --html2wt
ssastry raised the priority of this task from Medium to High.Oct 11 2017, 10:44 PM
ssastry moved this task from Needs Triage to Link syntax (links & media) on the Parsoid board.

Parsoid's current behavior is expected because "wikipedia" shows up before "en" in the interwiki maps that Parsoid gets back from M/W.
So, some of these things aren't designed with html -> wt needs in mind.
Bug, given that wikipedia is not a "language" interwiki, maybe we can build in a preference for language interwiki prefixes over others. since presumably that is the linking convention on wikis?
Alternatively, not sure if there is a way to get these interwiki maps reordered, but that might be a more onerous undertaking.

Change 384171 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/services/parsoid@master] Update reverse interwiki map to prefer language prefixes over others

ssastry claimed this task.Oct 13 2017, 9:17 PM
ssastry moved this task from Link syntax (links & media) to In Progress on the Parsoid board.

Change 384171 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Update reverse interwiki map to prefer language prefixes over others

Arlolra closed this task as Resolved.Oct 24 2017, 6:15 PM