css-inline
css-inline copied to clipboard
Logically invalid HTML is messed up
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>
It appears that missing quotes make html5ever parse it this way, or maybe this implementation can handle such cases, not 100% sure yet.
Oh sorry, it's not about the quotes, it's about putting a div directly in a table.
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