[wp-trac] [WordPress Trac] #24796: wp_enqueue_script causing HTML5 Validation Error
WordPress Trac
noreply at wordpress.org
Thu Jul 18 16:33:55 UTC 2013
#24796: wp_enqueue_script causing HTML5 Validation Error
--------------------------+-----------------------------
Reporter: tislam100 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Charset | Version: 3.5.2
Severity: normal | Keywords: needs-patch
--------------------------+-----------------------------
Some plugins are using wp_enqueue_script to display inline javascript
without src. the output of those scripts should be like this:
{{{
<script type="text/javascript">
custom javascript
</script>
}}}
but it adds the extra charset="utf-8" attribute which is not valid in
html5 without a src.
{{{
<script type="text/javascript" charset="utf-8">
custom javascript
</script>
}}}
wp_enqueue_script should check whether the called script has a src, if
not, then dont add the charset attribute. Imo this should be treated
seriously as most of the themes are now html5. and the html5 validity
status of this issue is "Error", not a "Notice".
Thanks
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24796>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list