Open kristoff-it opened 1 month ago
Looks like you forgot to escape the html tags, causing them to be hidden in the rendered version of your issue description. Copying the examples from the original lobste.rs comment by someone else: <p><p></p></p>
/ <p><div></div></p>
.
I got markdown'd, thanks!
I think the most comprehensive resource will be MDN. They have a "permitted content" entry for each element. For example, see footer
, which can have "flow content, but with no <footer>
or <header>
descendants."
I could do some scraping to generate a complete list if you want.
EDIT - I went ahead and made a list of all the nesting rules
The HTML spec defines that some elements cannot be nested in some other elements (eg
<div>
cannot go under<p>
).The task is to find the complete list, use some judgment to decide if it makes sense for our use case and then add all these cases as errors in the HTML parser code.