Page MenuHomePhabricator

Big DSR diff
Closed, ResolvedPublic


From jawiki:中央新幹線

----- JS:[486534, 486680] -----
<a rel="mw:ExtLink" href="" class="external text" data-parsoid='{"dsr":[72,133,44,1]}'>中央新幹線の概要 - 国土交通省

+++++ PHP:[486534, 486679] +++++
<a rel="mw:ExtLink" href="" class="external text" data-parsoid='{"dsr":[49,88,15,0]}'>中央新幹線の概要 - 国土交通省

This link is present in a <ref> which is present in an image caption which is present in a <gallery>

<gallery widths="200px">
File:Series L0.JPG|営業運転に投入予定の[[L0系]]
File:2016年10月時点の中央新幹線計画路線.jpg|2016年10月時点の中央新幹線計画路線<ref>[ 中央新幹線の概要 - 国土交通省]</ref>

Event Timeline

ssastry triaged this task as Medium priority.Oct 16 2019, 6:38 PM
ssastry created this task.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 16 2019, 6:38 PM
ssastry updated the task description. (Show Details)Oct 16 2019, 6:44 PM
ssastry lowered the priority of this task from Medium to Low.Oct 16 2019, 6:50 PM
ssastry added a subscriber: cscott.

So, this is probably just a conversion error, not an actual DSR compuation error. @cscott FYI.

I can reproduce (at least part of) the DSR differences with the following wikitext:

File:Foo.jpg|💩 caption <ref>[ foo💩 ]</ref>

The end of the output contains this in JS:

<a rel="mw:ExtLink" href="" class="external text" data-parsoid='{"dsr":[46,73,20,1]}'>foo💩 </a></span></li></ol></div></body></html>

and this in PHP:

<a rel="mw:ExtLink" href="" class="external text" data-parsoid='{"dsr":[46,73,18,1]}'>foo💩 </a></span></li></ol></div></body></html>

So the main body of the gallery has sensible DSRs:

<body data-parsoid='{"dsr":[0,84,0,0]}'
<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" data-parsoid='{"dsr":[0,83,9,10]}'
<div class="gallerytext" data-parsoid='{"dsr":[23,72,0,0]}'
<sup class="mw-ref" id="cite_ref-1" typeof="mw:Extension/ref" data-parsoid='{"dsr":[34,72,5,6]}'

And other outer wrapper of the auto-inserted <references/> is zero-width, but it contains the link with the bogus DSR (which fwiw is outside the boundary of its parent):

<div class="mw-references-wrap" typeof="mw:Extension/references" data-parsoid='{"dsr":[84,84,0,0]}'
<a rel="mw:ExtLink" href="" class="external text" data-parsoid='{"dsr":[46,73,20,1]}'>

in PHP that last is:

<a rel="mw:ExtLink" href="" class="external text" data-parsoid='{"dsr":[46,73,18,1]}'

...but both are bogus. The string at [46,73] is // foo💩 ]</ref>\n and neither the first 18 or 20 characters of that are a sensible "open tag" width.

I think the correct DSR should be [39,66,20,1].

ssastry assigned this task to cscott.Oct 25 2019, 2:22 PM

Change 546232 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/services/parsoid@master] Ensure that DOMFragments have shifted DSRs as well

Change 546232 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Ensure that DOMFragments have shifted DSRs as well

ssastry closed this task as Resolved.Oct 30 2019, 9:54 PM