Last modified: 2013-11-22 18:03:17 UTC
Is it allowed to have links inside a link in HTML5? The spec says no, it isn't.[1] But they are in the Echo overlay in the German Wikipedia: <a class="mw-echo-notification-wrapper" href="/wiki/User:..."> <div class="mw-echo-state"> <img class="mw-echo-icon" src=".../ThankYou.png"/> <div class="mw-echo-content"> <div class="mw-echo-title"> <a href="/wiki/User:..." class="mw-echo-grey-link">...</a> ... </div> <div class="mw-echo-notification-footer"> ... <a href="...&diff=..." class="mw-echo-notification-secondary-link mw-echo-grey-link">...</a> </div> <a href="/wiki/User:..." class="mw-echo-notification-primary-link">...</a> </div> </div> </a> This results in a real problem: I can't use the inner diff link. No matter what I do (shift click, ctrl click, middle mouse button, right button) it always opens the user page, never the diff. Tested with Opera 12. It seems it kind of "works" in Firefox and IE8. The problem is, you can't be sure because it's not defined in the spec. What Opera 12 does is not "wrong". Other user agent may have the same problem. That's why we have specs and validators. Invalid nesting should be avoided at all costs. [1]http://www.w3.org/TR/html5/text-level-semantics.html#the-a-element
It worked for me on Opera 12 when I tested; in fact I developed this on that browser. It worked everywhere else too. This is a dupe of bug 56418; see my argumentation there. But it does in fact appear that Opera has issues when trying to open that link in a new tab; it open correctly when you just click it, however. *** This bug has been marked as a duplicate of bug 56418 ***