Last modified: 2014-06-06 23:30:02 UTC
The https://commons.wikimedia.org/wiki/File:Icon_External_Link.svg icon should appear to the right of external links, but isn't currently.
The WMF core features team tracks this bug on Mingle card https://mingle.corp.wikimedia.org/projects/flow/cards/427, but people from the community are welcome to contribute here and in Gerrit.
Parsoid knows it's an external link but doesn't add the class "external text", or rel="nofollow" that a link in article HTML has. spage@ee-flow:~$ curl -d 'wt=[http://example.com external]' -d 'body=1' localhost:8000/localhost/Main_Page ... <a rel="mw:ExtLink" href="http://example.com" data-parsoid='{"targetOff":20,"contentOffsets":[20,28],"dsr":[0,29,20,1]}'>external</a> compared with wikitext HTML: <a href="http://example.com" class="external text" rel="nofollow">external</a>
The class does not seem to be needed in Parsoid output as the typeof attribute can be used instead. Creating updated styles is bug 51245. rel=nofollow is bug 52617.
Change 118447 had a related patch set uploaded by Matthias Mullie: Add selectors for Parsoid-output external links https://gerrit.wikimedia.org/r/118447
Change 118448 had a related patch set uploaded by Matthias Mullie: Add selector for Parsoid-output external links https://gerrit.wikimedia.org/r/118448
Change 118449 had a related patch set uploaded by Matthias Mullie: Add selectors for Parsoid-output external links https://gerrit.wikimedia.org/r/118449
Change 118450 had a related patch set uploaded by Matthias Mullie: Add selector for Parsoid-output external links https://gerrit.wikimedia.org/r/118450
Change 118451 had a related patch set uploaded by Matthias Mullie: Add selector for Parsoid-output external links https://gerrit.wikimedia.org/r/118451
Change 118452 had a related patch set uploaded by Matthias Mullie: Add selectors for Parsoid-output external links https://gerrit.wikimedia.org/r/118452
There's a couple of ways we could go about this: * Parsoid could add class="external" to external links * Skins' CSS could target [rel="mw:ExtLink"] too, like it currently only targets .external * Flow could hack around this, finding [rel="mw:ExtLink"] links and adding class="external" I would prefer not to do #3. I've uploaded a couple of patches that should do #2 in all skins & extensions that currently only target .external. Not sure if that's going to be an approach everyone will agree with. If it is, I'll do the same for rel="nofollow"
Shouldn't Parsoid simply use the external link class so we can turn that into a defacto standard? Is there any reason it can't?
I noticed "trying to generalize CSS / JS integration for Flow, VE etc" under "Parsoid" in the notes of the last scrum of scrums; I assume it's related to this bug. https://www.mediawiki.org/wiki/Scrum_of_scrums/2014-03-19
Change 118447 abandoned by Matthias Mullie: Add selectors for Parsoid-output external links Reason: Looks like Parsoid is working on this https://gerrit.wikimedia.org/r/118447
Change 118448 abandoned by Matthias Mullie: Add selector for Parsoid-output external links Reason: Looks like Parsoid is working on this https://gerrit.wikimedia.org/r/118448
Change 118449 abandoned by Matthias Mullie: Add selectors for Parsoid-output external links Reason: Looks like Parsoid is working on this https://gerrit.wikimedia.org/r/118449
Change 118450 abandoned by Matthias Mullie: Add selector for Parsoid-output external links Reason: Looks like Parsoid is working on this https://gerrit.wikimedia.org/r/118450
Change 118451 abandoned by Matthias Mullie: Add selector for Parsoid-output external links Reason: Looks like Parsoid is working on this https://gerrit.wikimedia.org/r/118451
Change 118452 abandoned by Matthias Mullie: Add selectors for Parsoid-output external links Reason: Looks like Parsoid is working on this https://gerrit.wikimedia.org/r/118452
I split 'adding rel="nofollow" to links' into bug 66289. Parsoid's CSS module in core (resources/src/mediawiki.skinning/content.parsoid.less) should output similar CSS to the changes in these abandoned patches, i.e. style a[rel="mw:ExtLink"] appropriately. Note the Vector skin no longer styles different URL formats (mailto, ftp) different) and file types (.mp3, .pdf) differently, but other skins like ?useskin=monobook do. There's another wrinkle to external links. Parser also outputs CSS class="free" if it's a bare external link in text (e.g. ... http://example.com ...) and outputs CSS class="text" if it's an external link in wikitext markup (e.g. ... [http://example.com foo] ...). Parsoid doesn't output these classes, though the information to distinguish them be in data-parsoid: {stx:"url"}. skins/common/commonPrint.css styles .text , and skins/common/shared.css styles .free.