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 https://ru.wikipedia.org/wiki/%D0%98%D0%BD%D0%BA%D1%83%D0%B1%D0%B0%D1%82%D0%BE%D1%80:%D0%9F%D0%B5%D1%81%D0%BE%D1%87%D0%BD%D0%B8%D1%86%D0%B0
  2. edit in normal editor, copy paste
aaa <ref name="p. 65">[[:en:Robert Gellately|Robert Gellately]]. ''[http://www.fsu.edu/news/2007/09/11/gellately.book/ Lenin, Stalin, and Hitler: The Age of Social Catastrophe]'' [[:en:Knopf|Knopf]], 2007 ISBN 1-4000-4005-1 [https://books.google.com/books?id=Q8bTWCJMqAQC&pg=PA65&dq=Lenin+ordered+the+executions&hl=en&ei=LBYZTMOwDYaglAfs_vC5Cw&sa=X&oi=book_result&ct=result&resnum=1&ved=0CCkQ6AEwAA#v=onepage&q=Lenin%20ordered%20the%20executions&f=false p. 65.]</ref> bbb ccc

save
https://ru.wikipedia.org/w/index.php?title=%D0%98%D0%BD%D0%BA%D1%83%D0%B1%D0%B0%D1%82%D0%BE%D1%80:%D0%9F%D0%B5%D1%81%D0%BE%D1%87%D0%BD%D0%B8%D1%86%D0%B0&diff=prev&oldid=88220994

  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
https://ru.wikipedia.org/w/index.php?title=%D0%98%D0%BD%D0%BA%D1%83%D0%B1%D0%B0%D1%82%D0%BE%D1%80:%D0%9F%D0%B5%D1%81%D0%BE%D1%87%D0%BD%D0%B8%D1%86%D0%B0&diff=next&oldid=88220994

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="https://en.wikipedia.org/wiki/Robert%20Gellately" 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="https://en.wikipedia.org/wiki/Hospet" rel="mw:ExtLink" title="Hospet">Hospet</a>' | parse.js --html2wt
[[wikipedia:Hospet|Hospet]]
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

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

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

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

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