Page MenuHomePhabricator

Link to log of a .pdf file should not have PDF icon
Open, LowPublic

Description

Author: matthew.britton

Description:
At the moment all links that end in ".pdf" seem to get the PDF icon. This is OK for links to external sites, but MediaWiki ought to be smart enough to use the correct icon when linking to elsewhere on the same wiki.

Thus a link like http://en.wikipedia.org/w/index.php?title=Special:Log&page=File:4chan_raid.pdf should not be rendered with a PDF icon.


Version: unspecified
Severity: enhancement
URL: http://en.wikipedia.org/w/index.php?title=Special:Log&page=File:4chan_raid.pdf

Details

Reference
bz17124

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:25 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz17124.
bzimport added a subscriber: Unknown Object (MLST).
demon added a comment.Jan 23 2009, 2:51 AM

Why shouldn't it? It's a PDF file and it's not formatted as an internal link.

(In reply to comment #1)

Why shouldn't it? It's a PDF file and it's not formatted as an internal link.

In fact it is *not* PDF file but XHTML - it doesn't point to PDF file itself, but to the log page of that file. It should have the standard "arrow-out" icon then.

brion added a comment.Jan 31 2009, 1:25 AM

This is a tricky thing to deal with -- you can't *actually* tell from a URL what the file type is going to be. :)

In theory a better selector could distinguish between the whole URL and the path before the query string ending in ".pdf", but I'm not sure how convenient that is... and it'll still give you false matches in cases like a link to a File: page.

matthew.britton wrote:

(In reply to comment #3)

This is a tricky thing to deal with -- you can't *actually* tell from a URL
what the file type is going to be. :)

Yeah... a true solution to this would probably be a way to link to internal pages without using the external link syntax (which I'm sure has already been requested elsewhere). This just caught my attention at one point.

How about using something like:

a[href*="/w/index.php"][href$=".pdf"] {
    /* whatever needed */
}
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 22 2016, 5:33 PM
Meno25 removed a subscriber: Meno25.Feb 22 2016, 6:01 PM
Krinkle removed a subscriber: Krinkle.Jul 29 2016, 8:10 PM