jsoup icon indicating copy to clipboard operation
jsoup copied to clipboard

jsoup allows all tags to self-close, while browsers do not

Open michaelhkay opened this issue 1 year ago • 3 comments

JSoup appears to generate an incorrect DOM in response to the (erroneous) input

<body>
  <video autoplay="" id="remote" width="240"/>
  <script>
    ...
  </script>
</body>

(The "/" in the video tag should be ignored; it should be treated as a start tag to be closed later.)

Chrome and Firefox, validator.nu and AngleSharp all put the script element as a child of the video element. JSoup leaves video and script as siblings.

michaelhkay avatar Jan 02 '23 13:01 michaelhkay

Thanks - this is the same as #917 and #1037. See notes on the latter in particular. We will need to implement the idea on that to be able to resolve this, I believe. Unless there are other ideas?

jhy avatar Jan 05 '23 04:01 jhy

Feel free to close as a duplicate. I quite agree that what JSoup is doing seems eminently reasonable in the circumstances, but we are more concerned with interoperability and conformance than with usability.

michaelhkay avatar Jan 05 '23 09:01 michaelhkay

I will leave it open as the closest #1037 is closed, and this description is clear.

jhy avatar Jan 05 '23 09:01 jhy