elixirschool / school_house

The new era of Elixir School now powered by @phoenixframework
https://elixirschool.com/
Apache License 2.0
155 stars 49 forks source link

HTML issue: Element “div” not allowed as child of element “h3” in this context. #170

Closed jaimeiniesta closed 3 years ago

jaimeiniesta commented 3 years ago

OK, after fixing #166 our next biggest HTML issue is "Element “div” not allowed as child of element “h3” in this context."

It happens 1,,159 times on the site:

https://rocketvalidator.com/s/2ab4490f-8a27-47b8-988a-31d55c878b77/i/115497173

For example on this page:

https://elixirschool.com/en/lessons/basics/date_time

https://rocketvalidator.com/s/2ab4490f-8a27-47b8-988a-31d55c878b77/p/4985170/i?search=Element+“div”+not+allowed+as+child+of+element+“h3”+in+this+context.+%28Suppressing+further+errors+from+this+subtree.%29&non_doc=false

And, is surprisingly close to the next issue "No “p” element in scope but a “p” end tag seen.":

https://rocketvalidator.com/s/2ab4490f-8a27-47b8-988a-31d55c878b77/i/115497174

Here's a sample HTML document that triggers this issue, so we know what we're looking for - some <div> inside an <h3>...</h3>, which is not allowed:

<!DOCTYPE html>
<html lang="">
<head>
<title>Test</title>
</head>
<body>
  <h3><div>bad</div></h3>
<p></p>
</body>
</html>
jaimeiniesta commented 3 years ago

Fixed in https://github.com/elixirschool/school_house/commit/a45b784da7a20fb2c929fcc1aabc3194915bfa3b