Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
michaelhkay opened this issue Jan 2, 2023 · 4 comments
Closed

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

michaelhkay opened this issue Jan 2, 2023 · 4 comments

Comments

@michaelhkay
Copy link

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.

@jhy
Copy link
Owner

jhy commented Jan 5, 2023

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?

@michaelhkay
Copy link
Author

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.

@jhy
Copy link
Owner

jhy commented Jan 5, 2023

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

@jhy jhy changed the title Incorrect DOM generated after erroneously-void element jsoup allows all tags to self-close, while browsers do not Jan 6, 2023
@jhy
Copy link
Owner

jhy commented Dec 14, 2024

(On review, closing as dupe of #917. I am thinking of addressing this by renovating how we hold properties in Tags, and allow configuration of self-closing / void tags. And then moving the HTML default back into spec.)

@jhy jhy closed this as not planned Won't fix, can't repro, duplicate, stale Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants