On Thu, 7 Oct 2004, Jorge Arellano Cid wrote:
On Wed, Oct 06, 2004 at 03:47:32PM +0200, Bjoern Brill wrote: [...]
Two small problems I've encountered:
- It seems that, if a pair of <a href="..."> </a> tags contains something illegal, like <div>, then the <a> tags are ignored, rather than the illegal stuff inside. That's suboptimal.
Can you elaborate on "suboptimal"?
If a heuristic tries to repair broken stuff, then the repair method with the likely most useable result is optimal. As things are now, <a><div>click here</div></a> ends up as <a></a><div>click here</div>, i.e. the link is empty and thus inaccessible.
The reason why <a> is closed is that INLINE elements can't contain BLOCK elements, so any inline elements left open are closed. This cleanup has proven very healthy.
[...] Yes, I fully agree here. My point is just that, since no visible trace of <a> is left, and links are a rather important part of page contents, another cleanup method may be better in this case.
As an example, look at http://www.kmelektronik.de/ (admittedly a very broken site, standards-wise). The text fragments "Light-Version Versand" and "Light-Version Shop" near the page bottom should really be links. If this is hard to fix, then don't bother.
Yes. The only other site I've found is www.lynucs.org which I expect to correct the problem when told.
I tried a small hack, but it has the side effect of not cleaning-up any INLINE element upon <div> openings. This solves the problem with the above mentioned pages, but may create bigger problems than what it solves.
[...]
Maybe a good solution is to only allow an exception when <a> precedes the <div>. This would be much safer.
Of course it would'n work with <a ...><b><div> </div></b></a>.
Now, considering the small amount of sites doing this, it may be an overkill. Please share your thoughts.
What about this: before forcibly closing <a> (no matter why), render some text like "[...]" or "[HTML bug]" to the page, so that the user can see what's going on? Special-casing <a><div> would likely be overkill. Special-casing <a><block_element> would not be, as long as the workaround is easy, simple and reasonably safe. If such a workaround does not exist, the issue isn't really worth more effort. Regards, Björn -- Bj"orn Brill <brill@fs.math.uni-frankfurt.de> Frankfurt am Main, Germany