Page MenuHomePhabricator

Add markup to article headings to distinguish between the namespace and the title
Open, Needs TriagePublic


The Editing Team want to be able to style the namespace separate from the heading in certain circumstances, as part of their talk pages project work. Example:

image.png (175×609 px, 46 KB)

(see T299814)

In order to do this we need some additional markup in the h1.firstHeading, at least one additional span.

Our proposal is to just wrap the namespace name in a span for now, as this will result in no changes to main article HTML.

Note: This change is not proposing any visual change to page headings. That will be done in much more limited and scoped places such as T299814, with staged rollouts and user options.

Event Timeline

Esanders updated the task description. (Show Details)

Change 780895 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/core@master] Wrap article title namespace in a <span> for selective styling in skins

@Whatamidoing-WMF This might be appropriate for tech news. It's a pretty small change, but if there is some gadget out there that adds <span>s to the main <h1>, then styles it with a too-generic selector like h1 > span then potentially this change could require some updates to that.

Test wiki created on Patch demo by JKlein (WMF) using patch(es) linked to this task:

@Jdlrobson I think it'd be a step towards it, at least from a display perspective -- it wouldn't help with the referenced translation concerns at all. It'd let the communities override the display via CSS, certainly, either to hide it entirely or to relocate it a bit. Though, that would make it easier to realize @Quiddity's concern about breaking the copy-paste workflows, but at least it'd be a community-chosen thing that we wouldn't have inherently pushed upon people (and e.g. in DiscussionTools we're making it *look* like there's a space, but it'll still copy just fine).