Page MenuHomePhabricator

Wrapping a link with <font> causes <font> to appear inside the link
Closed, DuplicatePublic

Description

When replacing <font> that wraps a link with a <span>, the HTML hierarchy is inversed, such that the link is the innermost element. I have created a minimal test case at https://sv.wikipedia.org/w/index.php?oldid=40896346. Unfortunately, when this happens, any color that the <font> element had is no longer visible, which means the intructions at https://www.mediawiki.org/wiki/Help:Extension:Linter/obsolete-tag aren't adequate.

Event Timeline

TTO added a subscriber: TTO.

No idea if Tidy is to blame here (haven't tested) but it seems likely.

No idea if Tidy is to blame here (haven't tested) but it seems likely.

Tidy

[subbu@earth maintenance] echo '<font>[[Foo]]</font>' | php parse.php --tidy
<div class="mw-parser-output"><p><a href="/wiki/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)"><font>Foo</font></a></p>
</div>

Remex

[subbu@earth maintenance] echo '<font>[[Foo]]</font>' | php parse.php --tidy
<div class="mw-parser-output"><p><font><a href="/wiki/index.php?title=Foo&amp;action=edit&amp;redlink=1" class="new" title="Foo (page does not exist)">Foo</a></font>
</p></div>

So, yes, this is Tidy. So, nothing to fix here since this will go away when Tidy is replaced.