Page MenuHomePhabricator

Selflinks should still be <a> tags with CSS styling via a class, not <strong> tags
Closed, ResolvedPublic0 Estimated Story Points


It's a pain to cope with and totally inelegant.

Tagging "Parser", though I believe these are made by Linker.

Whilst we're at it, we should use mw-selflink as the class name, to go with mw-redirect and mw-disambig.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 14 2017, 11:43 PM

So these would be clickable?

So these would be clickable?

At the decision of the renderer; in VE (where you need to interact with them), yes, in read-mode they could have pointer-events: none or whatever.

If that's a problem, we could make them literally <a>foo</a> (with no href), then they wouldn't be clickable and they wouldn't be styled as links.

Change 343204 had a related patch set uploaded (by Jforrester):
[mediawiki/core] [WIP] Linker: Render selflinks as classed <a>s, not <strong>s

and they wouldn't be styled as links

Well most selectors target a and not a[href] so there's still some overriding to do.

Change 343204 merged by jenkins-bot:
[mediawiki/core@master] Linker: Render selflinks as href-less classed <a>s, not <strong>s

Jdforrester-WMF closed this task as Resolved.Mar 29 2017, 11:45 PM
Jdforrester-WMF claimed this task.
Jdforrester-WMF removed a project: Patch-For-Review.
Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptMar 29 2017, 11:45 PM

Change 345525 had a related patch set uploaded (by Esanders):
[mediawiki/core@master] Follow-up If0588439: Fix color of active & visited selflinks

Change 345525 merged by jenkins-bot:
[mediawiki/core@master] Follow-up If0588439: Fix color of active & visited selflinks

Jdlrobson added a subscriber: Jdlrobson.EditedDec 8 2017, 8:37 PM

"It's a pain to cope with and totally inelegant."
Could you expand on this and give some context?

To me, it seems super strange (and broken) to have an anchor tag that will be styled by browser defaults as a link and clickable.
Other people do things with our content too outside MediaWiki (and we do too - mobile apps being one example), so why are we rendering this as a link and expecting the client rendering our content to know how to deal with it (it seems like change caused T181472 only just discovered)?

I don't actually think rendering a link without a href is actually very semantic nor helpful so I don't really understand why this was converted from a strong tag to a mw-selflink. Could you explain the history/rationale here?

Od1n added a subscriber: Od1n.Dec 30 2017, 10:06 AM

I was about to completely agree with Jdlrobson, but actually such links are HTML5's "placeholder links" and seem to be the recommended way…