Page MenuHomePhabricator

Ref fragments remain unexpanded in Image:Frameless, mw:ExpandedAttrs, mw:LanguageVariant nodes
Closed, ResolvedPublic

Description

Note that this is a Parsoid issue, not a Parsoid/PHP porting issue.

[subbu@earth:~/work/wmf/parsoid] echo '[[File:Foo.jpg|frameless|some ignored caption with an unexpanded ref<ref>boo</ref>]]' | parse.js --body_only
<p data-parsoid='{"dsr":[0,84,0,0]}'><figure-inline class="mw-default-size" typeof="mw:Image/Frameless" data-parsoid='{"optList":[{"ck":"frameless","ak":"frameless"},{"ck":"caption","ak":"some ignored caption with an unexpanded ref&lt;ref>boo&lt;/ref>"}],"dsr":[0,84,null,null]}' data-mw='{"caption":"some ignored caption with an unexpanded ref&lt;sup typeof=\"mw:DOMFragment/sealed/ref\" data-parsoid=&apos;{\"html\":\"mwf1\",\"extTagOffsets\":[68,82,5,6],\"dsr\":[68,82,5,6]}&apos; data-mw=&apos;{\"name\":\"ref\",\"attrs\":{},\"body\":{\"extsrc\":\"boo\"}}&apos;>&lt;/sup>"}'><a href="./File:Foo.jpg" data-parsoid="{}"><img resource="./File:Foo.jpg" src="//upload.wikimedia.org/wikipedia/commons/thumb/0/06/Foo.jpg/220px-Foo.jpg" data-file-width="300" data-file-height="197" data-file-type="bitmap" height="144" width="220" data-parsoid='{"a":{"resource":"./File:Foo.jpg","height":"144","width":"220"},"sa":{"resource":"File:Foo.jpg"}}'/></a></figure-inline></p>

Here is another test snippet:

{|
|-<ref>boo</ref>
|x
|}

on which we get output:

<table data-parsoid='{"dsr":[0,25,2,2]}'>
<tbody data-parsoid='{"dsr":[3,23,0,0]}'><tr about="#mwt4" typeof="mw:ExpandedAttrs" data-parsoid='{"startTagSrc":"|-","a":{"&lt;ref>boo&lt;/ref>":null},"sa":{"&lt;ref>boo&lt;/ref>":""},"dsr":[3,22,16,0]}' data-mw='{"attribs":[[{"txt":"","html":"&lt;sup typeof=\"mw:DOMFragment/sealed/ref\" data-parsoid=&apos;{\"html\":\"mwf1\",\"extTagOffsets\":[5,19,5,6],\"dsr\":[5,19,5,6]}&apos; data-mw=&apos;{\"name\":\"ref\",\"attrs\":{},\"body\":{\"extsrc\":\"boo\"}}&apos;>&lt;/sup>"},{"html":""}]]}'>
<td data-parsoid='{"dsr":[20,22,1,0]}'>x</td></tr>
</tbody></table>

Related Objects

Mentioned In
T235231: Parsoid/JS video tag has a "seek" parameter in the URL that Parsoid/PHP video tag output doesn't
T237556: Detect html2wt reqs issued to Parsoid/PHP with data-parsoid blobs generated by Parsoid/JS and issue a HTTP 421
T236846: TemplateHandler.php: trim() expects parameter 1 to be string, boolean given
T235217: Parsoid should use protocol-relative URLs for media
T235295: MathML tags are missing xmlns attribute
T215000: Fill gaps in PHP DOM's functionality
T236112: Missing contentmodel handlers for everything but wikitext
T227209: Security Review For Parsoid-PHP
T234549: "Properly" address missing srcText issues in PageConfigFrame / missing revID in REST API
T233818: Call to a member function getContent() on null
Mentioned Here
T215000: Fill gaps in PHP DOM's functionality
T235217: Parsoid should use protocol-relative URLs for media
T235231: Parsoid/JS video tag has a "seek" parameter in the URL that Parsoid/PHP video tag output doesn't
T235295: MathML tags are missing xmlns attribute
T236846: TemplateHandler.php: trim() expects parameter 1 to be string, boolean given
T237556: Detect html2wt reqs issued to Parsoid/PHP with data-parsoid blobs generated by Parsoid/JS and issue a HTTP 421
rGPAR6a0a7085a258: Remove seek stripping from html diffing script
T227209: Security Review For Parsoid-PHP
T233818: Call to a member function getContent() on null
T234549: "Properly" address missing srcText issues in PageConfigFrame / missing revID in REST API
T236112: Missing contentmodel handlers for everything but wikitext
rGPAR5ac16239cf61: Process <ref>s found in nodes with mw:ExpandedAttrs typeof

Event Timeline

ssastry triaged this task as Medium priority.Oct 16 2019, 2:00 PM
ssastry created this task.

Hm. Where should the ref go -- does PHP actually generate an entry in <references/> for this (gosh, I hope so...)?

EDIT: It does! (whew!)

Change 546295 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/services/parsoid@master] Ensure frameless images have their <ref>s included in <references/>

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

Change 546295 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Ensure frameless images have their <ref>s included in <references/>

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

Change 546384 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/services/parsoid@master] Process <ref>s found in nodes with mw:ExpandedAttrs typeof

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

Change 546384 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Process <ref>s found in nodes with mw:ExpandedAttrs typeof

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

Looks like language variant markup is another source:

<span typeof="mw:LanguageVariant" data-mw-variant='{"filter":{"l":["zh","zh-hans","zh-hant"],"t":"鴻孕當頭&lt;sup typeof=\"mw:DOMFragment/sealed/ref\" data-parsoid=&apos;{\"src\":\"&amp;lt;ref name=\\\"atmovies-fjen00467406-2008\\\">{{@movies||id=fjen00467406|title=鴻孕當頭(Juno)}}&amp;lt;/ref>\",\"html\":\"mwfX\",\"extTagOffsets\":[3733,3767,13,2]}&apos; data-mw=&apos;{\"name\":\"ref\",\"attrs\":{\"name\":\"atmovies-fjen00467406-2008\"},\"body\":{\"extsrc\":\"{{@movies||id=fjen00467406|title=鴻孕當頭(Juno)}}\"}}&apos;>&lt;/sup>"}}'>
zh.wikipedia.org/Juno\%E5\%B0\%91\%E5\%A5\%B3\%E5\%AD\%95\%E8\%A8\%98 (END)
ssastry renamed this task from Ref fragments remain unexpanded in Image:Frameless and mw:ExpandedAttrs nodes to Ref fragments remain unexpanded in Image:Frameless, mw:ExpandedAttrs, mw:LanguageVariant nodes.Nov 6 2019, 2:20 AM

Change 549163 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/services/parsoid@master] WIP: One more fix for T235656

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

Change 549163 merged by jenkins-bot:
[mediawiki/services/parsoid@master] One more fix for T235656

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

ssastry claimed this task.