Page MenuHomePhabricator

Expanded URLs should not be generated at server
Closed, ResolvedPublic

Description

Author: tom

Description:
Expanded URLs in parentheses generated for printing after external links (but only when the link text
isn't the URL) should be a purely client-side business.

These URLs are currently outputted as plain text, which has accessibility side-effects - I doubt many
screen-reader users want to hear the URL of every external link in the page.

They should be generated on the client via CSS, using:

element:after { content: " (" attr(href) ") "; }

IE/win however doesn't support generated content, so it can have some JS (already written) to do the same
thing.


Version: unspecified
Severity: normal

Details

Reference
bz642
TitleReferenceAuthorSource BranchDest Branch
configure-projects: add an issue allowlist and tidy log outputrepos/releng/gitlab-settings!10brennenwork/brennen/allowlistmain
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 6:56 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz642.

tom wrote:

To do this, the current thinking is to have 3 different CSS classes for external links:

  • One for external links with custom text
    • generated by "[http://moo.com moo]", displayed as "moo"
    • should be printed as "moo (http://moo.com)"
  • One for external links where the link text is the same as the URL
    • generated by "http://moo.com" or "[http://moo.com http://moo.com]"
    • should be printed as "http://moo.com"
  • One for external links that are autonumbers
    • generated by "[http://moo.com]", displayed as "[1]"
    • should be printed as something like "[http://moo.com]"

mpt wrote:

IE/win however doesn't support generated content

IE/Win does, however, have the option of printing each link
as an endnote, with a table of link URIs at the end of the
page. So there's no need to reimplement this server-side
just for IE/Win.

tom wrote:

Patch to move URL expantion to CSS (or JS for IE)

Here's a patch which seems to work, would appreciate it if someone could review
it (as I don't have all that much faith in my coding...).

It uses generated content for browsers which support it, or JS in IEFixes.js
with onbeforeprint/onafterprint.

attachment external-link-class.patch ignored as obsolete

tom wrote:

New patch, serveral fixes

Updated patch: use "free" (not URL) as class when autonumber is disabled;
remove suppressUrlExpansion from Skins (not needed anymore)

attachment phase3.patch ignored as obsolete

tom wrote:

Patch take 3: remove all instances of .urlexpansion in CSS

attachment phase3.patch ignored as obsolete

rowan.collins wrote:

[please CC the bug-list-bot when changing the assignment of a bug]