Skip to content
This repository has been archived by the owner on Mar 28, 2019. It is now read-only.

Detect & report "Element X not allowed inside of element Y" error type. #91

Open
flukeout opened this issue Sep 28, 2017 · 0 comments
Open

Comments

@flukeout
Copy link

According to the research done by Thomas Park, one of the most common error types experienced by learners of HTML is that they put an element inside of another that shouldn't be there.

Consider the case below...

    <p>
      <h1>lol</h1>
    </p>

Based on the recent work we've been doing. This might throw an error because the initial <p> becomes auto-closed as soon as the <h1> happens, and so we would flag the fact that there was an orphan </p> at the bottom.

What we should really report is that the <h1> isn't allowed inside of a <p> and highlight that as the thing to fix.

Question, besides block elements not being allowed into inline elements, are there any other restrictions? I guess a paragraph is a block level, but only accepts inline elements? We should find a list of these rules and figure out how to codify them.

cc @Pomax - does this seem right to you based on what we discussed earlier?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant