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

Logically invalid HTML is messed up #435

Open
adrian-zon opened this issue Mar 14, 2025 · 3 comments
Open

Logically invalid HTML is messed up #435

adrian-zon opened this issue Mar 14, 2025 · 3 comments

Comments

@adrian-zon
Copy link
Contributor

Input:

<!DOCTYPE html>
<html>
  <head>
    <title>TITLE</title></head>
  <body>
    <table class=wrapper>
      <div class="parent">
        <table class="child"></table>
      </div>
    </table>
  </body>
</html>

Output:

<!DOCTYPE html><html><head>
    <title>TITLE</title></head>
  <body>
    <div class="parent">
        </div><table class="wrapper">
      </table><table class="child"></table>
      
    
  
</body></html>
@Stranger6667
Copy link
Owner

It appears that missing quotes make html5ever parse it this way, or maybe this implementation can handle such cases, not 100% sure yet.

@adrian-zon
Copy link
Contributor Author

Oh sorry, it's not about the quotes, it's about putting a div directly in a table.

@Stranger6667
Copy link
Owner

Right, I see it now! div can't be used in table as per the HTML spec and I see that e.g. chromium does a similar thing - https://jsfiddle.net/ELzs3/1/ (found that on SO) where div is ejected outside of table. It may work with quirks mode, but I need to try it

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