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.