NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 764 - p tag errors
p tag errors
Status: RESOLVED NOTREPRODUCIBLE
Product: Validator.nu
Classification: Unclassified
Component: HTML parser
HEAD
All All
: P2 normal
Assigned To: Nobody
http://stev.dk/index_html5.php
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-09-19 22:53 CEST by vsx1015
Modified: 2010-09-20 02:26 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vsx1015 2010-09-19 22:53:14 CEST
Get error: No p element in scope but a p end tag seen.

<section id="express-box">
<header>
<h2><b>Klum</b>men</h2>
</header>
<p><!-- p tag set -->
Kompetencer...
<ul>
<li>HTML / XHTML / HTML5</li>
<li>CSS</li>
<li>JavaScript</li>
<li>PHP</li>
<li>MySQL</li>
</ul>
</p><!-- this p tag gets an error -->
<blockquote><p>Touch the book - lick the book...</p></blockquote>
</section>
Comment 1 Michael[tm] Smith 2010-09-20 02:17:05 CEST
This is expected behavior.

If you want to avoid it, you should use a <div> element there instead of a <p>. Because a <ul> element is not valid as a child <p> element.

So the reason you see that message is, the HTML parser is closing that <p> element before the <ul> element. That's what the HTML parsing algorithm says it must do: The <ul> start tag "implies" to the parser that it must close any open <p> elements.

So, when the parser subsequently finds the </p> end tag later in the tree, it reports an error because it no longer has any <p> element open ("in scope").
Comment 2 Michael[tm] Smith 2010-09-20 02:26:32 CEST
btw, if you want to examine how your browser actually parses that document fragment, you check that here: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/639