Last modified: 2014-10-12 19:44:22 UTC
When Tidy is enabled, wikitext like [[Link|<div>Text</div>]] will not actually produce a clickable link. That's because Tidy "unwraps" the <div/> outside of the <a/> tag.
I believe this is pretty much common knowledge, but it seems we have no bug filed for it and there clearly aren't enough Tidy-related bugs filed if no one has killed it yet.
The workaround is to use [[Link|<span style="display: block;">Text</span>]], as stupid as that looks.
Tidy's first rule is not to allow block-level elements inside an inline-level element. This bug describes what Tidy is supposed to do, albeit not what is desired. Not going to be fixed, because Tidy isn't HTML5-aware and hasn't been maintained since 2008.
The only solution is to switch to Tidy-html5  (an experimental fork), or make its functionality part of parsoid. Either way, bug 54617 deals with updating/upgrading Tidy.
<a/> is not an inline element, it's a transparent element . It was an inline element according to HTML 4 spec , but as far as I know no browser ever implemented it as such (even IE 6 happily allows block content in links). This is indeed an aspect of Tidy's incompatibility with HTML 5.
I don't think this deserves a WONTFIX any more than the other dozens of blockers to bug 2542 do.
Wontfix, cantfix... the point is, there is no fix, save replacing the legacy Tidy. So how about marking all Tidy bugs dependent/duplicate of bug 54617?
Many of these could probably be worked around in MediaWiki if someone put in the necessary effort.
That would be an inordinate ammount of effort... Let's be realistic and just upgrade to Tidy-html5.