Page MenuHomePhabricator

Missing images render as broken img tags, not redlinks
Closed, ResolvedPublic

Description

PHP:


Parsoid:

With PHP it is clear we have created a "red link" and not just that the image failed to load due to some intermittent network failure.

The counterpoint is that as a document model, the Parsoid version is much more consistent. If we removed the <img> tag we'd need to put alt, link and dimensions somewhere else, and clients would need to be updated (although VE already special-cases mw:Error images to make our CE rendering look more like the PHP output)

Related Objects

StatusAssignedTask
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
DeclinedNone
ResolvedCatrope
ResolvedSbailey
DeclinedNone
OpenNone
Resolved GWicke
ResolvedNone
Resolvedssastry
OpenNone
ResolvedDbrant
ResolvedbearND
ResolvedMholloway
ResolvedNone
DuplicateNone
ResolvedJdforrester-WMF
ResolvedbearND
OpenNone
OpenNone
ResolvedArlolra
ResolvedArlolra

Event Timeline

Esanders created this task.Jul 7 2017, 11:10 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 7 2017, 11:10 AM
cscott added a subscriber: cscott.Jul 11 2017, 3:40 PM

Discussed today at parsing-team meeting.

Some examples of PHP output for broken images with explicit link attributes at https://en.wikipedia.org/wiki/User:Cscott/Sandbox

Note that the link= attribute for the broken image gets ignored & replaced with a link to Special:Upload for a broken image:

There's some social aspects of the PHP design here, in particular the ability for readers to click through a redlink to fix it (in the same way that article redlinks work).

Two options were discussed.

Option "Stuff a span":

  1. replace <img> with <span>File:....</span>, preserving the overall tree structure of image markup for consistency.

2a) hoist any wikitext link attribute into data-mw for roundtripping
2b) alternatively, hoist the wikitext link property into a new origHref attribute (bikeshedding name welcome)

  1. replace href attribute of <a> tag with a direct link to [[special:upload]] for PHP compat (and social compatibility)
  2. leave the mw:Error in the typeof

Option "Use a non-broken image"

  1. Add filename as an alt attribute to the image, add a class to the a-tag, and change the img src to point to a real non-broken image (maybe [[Special:BrokenImage.png]] or something like that)

2a/2b, 3, 4) as above

Arlolra triaged this task as Normal priority.Jul 19 2017, 9:10 PM
Arlolra claimed this task.
ssastry moved this task from Backlog to Read Views on the Parsoid board.Jan 11 2018, 9:18 PM

This is an issue for the implementation of T118517 in https://gerrit.wikimedia.org/r/#/c/196532/ since the dimensions are only on the image which, as the task describes, is absent in the current php rendering.

Reedy edited projects, added Parsoid-Read-Views; removed Parsoid.Sep 17 2018, 7:25 PM

Change 463125 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] [WIP] Add media info in a post-processing pass

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

Change 463125 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Add media info in a post-processing pass

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

Arlolra closed this task as Resolved.Feb 6 2019, 6:28 PM