Bugzilla – Bug 1018
Error: No p element in scope but a p end tag seen.
Last modified: 2015-02-02 03:16:43 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.
Created attachment 234 [details] Screenshot of the error message I recieved
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.