Page MenuHomePhabricator

CLASS attribute missing in [[File:...|link=...]]
Open, MediumPublicFeature

Description

Author: support

Description:
When using the '|link=' option within [[File:]] the 'image' class is not applied to the <a> attribute.

This makes it difficult to style the output with CSS.

Please can a class be added to the <a> attribute for images in all cases.

If class 'image' is deemed inappropriate, then perhaps 'imageLink' could be used?

Example with class:

WIKITEXT:
[[File:filename.jpg]]
HTML:
<a href="/wikipath/index.php/File:filename.jpg" class="image">
    <img alt="filename.jpg" src="/wikipath/images/da/da/filename.jpg" ...etc />
</a>

Example without class:

WIKITEXT:
[[File:filename.jpg|link=http://wikimedia.org]]
HTML:
<a href="http://wikimedia.org">
    <img alt="filename.jpg" src="/wikipath/images/da/da/filename.jpg" ...etc />
</a>

Footnote:
Bug T25226 would be useful to have also, but in addition to the default class that should be there per above.


Version: 1.17.x
Severity: enhancement

Details

Reference
bz29920

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:31 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz29920.
bzimport added a subscriber: Unknown Object (MLST).

Ruslik00 wrote:

Yes, it would be useful if 'image' class were assigned to any anchor with the image inside.

This didn't use to be the case, so it must have been changed some time before the bug was created. It would be useful to get the class back, whether it be "image" or something else.

jayvdb set Security to None.
jayvdb updated the task description. (Show Details)
Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 12:24 PM
Aklapper removed a subscriber: wikibugs-l-list.