NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 1018 - Error: No p element in scope but a p end tag seen.
Error: No p element in scope but a p end tag seen.
Status: RESOLVED INTENTIONAL
Product: Validator.nu
Classification: Unclassified
Component: HTML parser
HEAD
All All
: P2 minor
Assigned To: Nobody
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-02-01 15:07 CET by solemnxirae
Modified: 2015-02-02 03:16 CET (History)
2 users (show)

See Also:


Attachments
Giving one redacted snippet (from validator.nu) that received an error (1.08 KB, text/plain)
2015-02-01 15:07 CET, solemnxirae
Details
Screenshot of the error message I recieved (55.85 KB, image/png)
2015-02-01 15:09 CET, solemnxirae
Details

Note You need to log in before you can comment on or make changes to this bug.
Description solemnxirae 2015-02-01 15:07:35 CET
Created attachment 233 [details]
Giving one redacted snippet (from validator.nu) that received an error

The validator is claiming there are two errors regarding p tags.

However, those p tags are open and closed appropriately.

I've checked other pages I made, and have similar results.
Comment 1 solemnxirae 2015-02-01 15:09:27 CET
Created attachment 234 [details]
Screenshot of the error message I recieved
Comment 2 Michael[tm] Smith 2015-02-02 03:16:43 CET
Hi,

What you're seeing is actually expected behaviorーthe validator is just conforming to requirements in the HTML spec here.

You can eliminate the error either by omitting the p end tag or by putting a p end tag before the ul start tag.


The reason is, the ul element is not allowed as a child of the p element. And when a conforming HTML parser encounters a ul when a p element is still open, the HTML spec requires the parser to generate a p end tag. So that's what's happening in your case here. The when the parser finds another p end tag after the ul end tag, it emits an error, since there is no longer an open p element (because the parser closed it before the ul start tag).

One easy way to avoid ever running into this is just to never put p end tags in your source. You pretty much don't ever need to actually use them.