This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26084 - Validator reports "Empty heading" warning when only heading content is a script element
Summary: Validator reports "Empty heading" warning when only heading content is a scri...
Status: NEW
Alias: None
Product: HTML Checker
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael[tm] Smith
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-13 14:04 UTC by Porter Scobey
Modified: 2015-08-23 06:58 UTC (History)
1 user (show)

See Also:


Attachments

Description Porter Scobey 2014-06-13 14:04:17 UTC
Line 11, Column 8: Empty heading.

 <h3><script type="text/javascript" src="scripts/buy3.js"></script></h3>

The above line of markup causes the warning on the first line. The warning goes
away if I simply insert an x as follows:

 <h3><script type="text/javascript" src="scripts/buy3.js"></script>x</h3>

It would seem that script output should be acceptable as heading content, so
this scenario should not generate a warning.
Comment 1 Michael[tm] Smith 2014-07-08 14:45:27 UTC
(In reply to Porter Scobey from comment #0)
> Line 11, Column 8: Empty heading.
> 
>  <h3><script type="text/javascript" src="scripts/buy3.js"></script></h3>
> 
> The above line of markup causes the warning on the first line.

That empty-heading warning is something I added fairly recently, experimentally, and I'm pretty close to deciding to just drop it. For one thing, if you're generating heading content from script, the script doesn't need to be child of the heading anyway -- it could (probably should) be at the end of the document anyway.

So I'll probably turn off the empty-heading warning in next couple of weeks.

As an aside: If you're doing things like generating your heading content from script, you might want to consider validating your generated content rather than your source.

At http://codepen.io/stevef/full/LasCJ/ you can find a bookmarklet that enables you to use the validator to check the serialized DOM of any Web page.