Page MenuHomePhabricator

Headings containing special characters get additional margin-left in mobile version
Closed, DuplicatePublicBUG REPORT

Description

List of steps to reproduce:

  • Open a page with various headings in the mobile version, e.g. Hillary Clinton.
  • Compare headings with and without special characters (e.g. the first and second h2 in the Hillary Clinton article).

What happens?:
Headings with special characters contain a leading empty span with an encoded anchor id. This span is preceded by the mw-ui-icon to collapse and uncollapse the headings on mobile. Minerva applies the following CSS:

.mw-ui-icon + span {
    margin-left: 8px;

This means that any heading with special characters will also have an additional margin-left of 8px.

What should have happened instead?:
There should be no additional 8px margin. Normally, headings contain spans with class mw-headline, to which Minerva explicitly applies margin-left: 0;. This should also be done for any empty spans, probably best by assigning them a new class. Otherwise, the indentation of headings can vary throughout a page.

The effect of this bug reminded me of T303489, but there everything happens within the mw-headline, so they are clearly not related.

Event Timeline

A screenshot of Hillary Clinton in enWP with all sections collapsed

Bildschirmfoto von »2022-05-08 00.08.00«.png (880×873 px, 68 KB)

The first one "Early life …" is okay and at the very left, then 3 with special chars causing some encoding are shifted left, then "2008 presidential …" is okay again and so on.