Justin Patterson
-
2007-07-17
element is its own parent
Brought to you by:
derrickoswald
I came across something that looked like this on the Internet: <a href="..."/><img src="..."/></a>. Note that the a tag is closed twice. The HTML parser creates a document where the tag's parent is itself. This seems bad. It caused an infinite loop in my program where I'm trying to see if it's contained in a particular element.
JUnit test attached.