Page MenuHomePhabricator

Parsoid lacks support for mustRender
Open, LowPublic

Description

For any file type where the handler returns true from mustRender(), such as SVG, PDF, DjVu, etc., the renderer is required to not attempt to link directly to the file in an <img/> tag. For example, for wikitext input [[File:Cross.svg]], the MW output is

<a href="/wiki/File:Cross.svg" class="image"><img alt="Cross.svg" src="//upload.wikimedia.org/wikipedia/commons/thumb/8/8b/Cross.svg/32px-Cross.svg.png" width="32" height="32" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/8/8b/Cross.svg/48px-Cross.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/8/8b/Cross.svg/64px-Cross.svg.png 2x" data-file-width="32" data-file-height="32" /></a>

whereas Parsoid attempts client-side scaling regardless of the file type:

...<img resource="./File:Cross.svg" src="//upload.wikimedia.org/wikipedia/commons/8/8b/Cross.svg" data-file-width="32" data-file-height="32" data-file-type="drawing" height="32" width="32" data-parsoid='...'/>

Event Timeline

tstarling raised the priority of this task from to Needs Triage.
tstarling updated the task description. (Show Details)
tstarling added a subscriber: tstarling.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 10 2015, 6:47 AM

Change 238082 had a related patch set uploaded (by Tim Starling):
Fix support for height parameter and mustRender

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

The patch above fixes the issue only if the batch API is enabled.

Change 238082 merged by jenkins-bot:
Fix support for height parameter and mustRender

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

Change 238356 had a related patch set uploaded (by Tim Starling):
Fix support for height parameter and mustRender

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

Change 238356 merged by jenkins-bot:
Fix support for height parameter and mustRender

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

ssastry triaged this task as Low priority.Sep 16 2015, 10:51 PM
ssastry removed a project: Patch-For-Review.
ssastry set Security to None.
ssastry removed a subscriber: gerritbot.
ssastry added a subscriber: ssastry.

This support is now there in the Parsoid Batching API. If all testing goes well, that will be enabled in production next week. So, the only thing left here is support in the non-batching API. It is unclear how easy it is to do it there, and if the batching API becomes the default, it is low priority to do this for the non-batching API use case.

ssastry moved this task from Backlog to Read Views on the Parsoid board.Jan 11 2018, 9:37 PM
Reedy edited projects, added Parsoid-Read-Views; removed Parsoid.Sep 17 2018, 7:25 PM