Page MenuHomePhabricator

Hatnote templates do not merge
Closed, ResolvedPublicBUG REPORT

Description

Step to replicate the issue (include links if applicable):

Go to a page that has multiple hatnote templates in a row

What happens?:
The hatnote templates show a space between them.

What should have happened instead?:

The hatnote templates should be in a single block (like the legacy parser does).

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Browser: Google Chrome

Current Parsoid behavior:

image.png (982×98 px, 11 KB)

Legacy parser behavior (correct):
image.png (982×95 px, 11 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

We can't see those files. Please attach them per https://www.mediawiki.org/wiki/Phabricator/Help#File_visibility

That said, I can reproduce the issue and don't really need images to demonstrate it.

This is caused by the selector at https://en.wikipedia.org/w/index.php?title=Module:Hatnote/styles.css&oldid=1320445320#L-19, which doesn't apply on parsoid, as there are no link elements for the deduplicated styles between the divs. There should probably also be a selector for .hatnote + .hatnote that applies the same styles.

This is caused by the selector at https://en.wikipedia.org/w/index.php?title=Module:Hatnote/styles.css&oldid=1320445320#L-19, which doesn't apply on parsoid, as there are no link elements for the deduplicated styles between the divs. There should probably also be a selector for .hatnote + .hatnote that applies the same styles.

The actual issue was caused by T378906: Categories as link tags cause navboxes to have a rendering difference. I will probably need to fix onwiki with the new approach there, but I don't want to do that until the new approach is live (circa Thursday this week).

We can't see those files. Please attach them per https://www.mediawiki.org/wiki/Phabricator/Help#File_visibility

First time attaching images here, so thanks for the notice haha

This is caused by the selector at https://en.wikipedia.org/w/index.php?title=Module:Hatnote/styles.css&oldid=1320445320#L-19, which doesn't apply on parsoid, as there are no link elements for the deduplicated styles between the divs. There should probably also be a selector for .hatnote + .hatnote that applies the same styles.

The actual issue was caused by T378906: Categories as link tags cause navboxes to have a rendering difference. I will probably need to fix onwiki with the new approach there, but I don't want to do that until the new approach is live (circa Thursday this week).

Once the final fixes roll out next week, we'll add instructions to https://www.mediawiki.org/wiki/Parsoid/Parser_Unification/Instructions_for_editors#Adapt_CSS ,

And needed a followup to keep the old version until Parsoid is the only parser.

@Izno This page has two hatnote templates that do not merge. Is it because there are "hidden" templates between them?

Yes. That one is solved by fixing the wikitext.