Opera 10 Anchor Tag Rendering Bug

For some time now, Wesabe’s transaction edit dialog has been broken in Opera (10.10 as of this writing). Since it was fine in all other major browsers, and none of us were Opera users, fixing it was never high priority. I thought I’d take a look at it again tonight, though, and just when I was about to give up and go to bed, I managed to track it down.

If you have an anchor (<a>) tag that contains block-level elements (which is technically not allowed, but all other browsers seem to be ok with it), such as <p> or <div>, the anchor will close itself before the elements it is supposed to contain. E.g.: <a> <p>hello</p> </a> Will render as: <a> </a> <p>hello</p>

If you give the anchor an href, though, even if it is just a blank string (<a href="">...), it renders fine.

Here’s a page that demonstrates the bug: http://footle.org/misc/opera-bug.html.

Anyway, I filed a bug with the Opera folks. Time for bed.