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 [1] (an experimental fork), or make its functionality part of parsoid. Either way, bug 54617 deals with updating/upgrading Tidy. [1] https://github.com/w3c/tidy-html5
<a/> is not an inline element, it's a transparent element [1]. It was an inline element according to HTML 4 spec [2], 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. [1] http://www.w3.org/TR/html5/text-level-semantics.html#the-a-element [2] http://www.w3.org/TR/html401/struct/links.html#h-12.2
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.