Page MenuHomePhabricator

Big DSR diff
Closed, ResolvedPublic

Description

From jawiki:中央新幹線

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

+++++ PHP:[486534, 486679] +++++
<a rel="mw:ExtLink" href="http://www.mlit.go.jp/common/001058063.pdf" 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:Yamanashi-Linear-Motor-Car-test-course1.JPG|[[リニア実験線|山梨リニア実験線]]
File:Series L0.JPG|営業運転に投入予定の[[L0系]]
File:2016年10月時点の中央新幹線計画路線.jpg|2016年10月時点の中央新幹線計画路線<ref>[http://www.mlit.go.jp/common/001058063.pdf 中央新幹線の概要 - 国土交通省]</ref>
</gallery>

Event Timeline

ssastry triaged this task as Medium priority.Oct 16 2019, 6:38 PM
ssastry created this task.
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:

<gallery>
File:Foo.jpg|💩 caption <ref>[https://cscott.net foo💩 ]</ref>
</gallery>

The end of the output contains this in JS:

<a rel="mw:ExtLink" href="https://cscott.net" 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="https://cscott.net" 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="https://cscott.net" class="external text" data-parsoid='{"dsr":[46,73,20,1]}'>

in PHP that last is:

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

...but both are bogus. The string at [46,73] is //cscott.net 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].

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

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

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

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