I recently rebuilt my website in HTML5 and in doing so discovered a fun little issue with how w3m nests elements inside links.
In HTML5 there is now the allowance for what were previously considered block-level elements to nest inside what were previously considered inline elements, since the specification now completely separates presentation from markup. The end result of this is that with code like:
<a href=“http://example.com/“><div>some text</div></a>
the “some text” text does not behave as a link in w3m, despite it being a clickable target in most browsers (and validating correctly on the HTML5 validator at validator.w3.org).
I replicated this bug on the latest version of w3m built via homebrew on macOS:
$ w3m -version
w3m version w3m/0.5.3+git20180125, options lang=en,m17n,color,ansi-color,mouse,menu,cookie,ssl,ssl-verify,external-uri-loader,w3mmailer,nntp,ipv6,alarm,mark
I have changed my nested elements to be instead of
This text should have read:
but apparently sourceforge doesn't sanitize their HTML and also doesn't provide a means of editing a ticket description. Oops.
In Debian's w3m Git repo, w3m now supports links containing divs for HTML5.