Bert Vanhooff created MWEBMINI-8:
------------------------------------
Summary: Script tags without type attribute are omitted
Key: MWEBMINI-8
URL: https://jira.codehaus.org/browse/MWEBMINI-8
Project: Mojo Web Minifier Maven Plugin
Issue Type: Bug
Affects Versions: 1.0.1
Reporter: Bert Vanhooff
In html5 the type attribute in the script tag is optional (javascript is the
default).
{code}
<script scr="a.js"></script>
<!-- should be treated equivalent to -->
<script scr="a.js" type="text/javascript"></script>
{code}
The first alternative is ignored by the plugin as not being a javascript file.
Solution:
In DocumentResourceReplacer, replace this
{code}
private boolean isJSType( NamedNodeMap scriptAttrNodes )
{
Attr typeAttrNode = (Attr) scriptAttrNodes.getNamedItem( "type" );
return ( typeAttrNode != null && typeAttrNode.getValue().equals(
"text/javascript" ) );
}
{code}
by this
{code}
private boolean isJSType( NamedNodeMap scriptAttrNodes )
{
Attr typeAttrNode = (Attr) scriptAttrNodes.getNamedItem( "type" );
return ( typeAttrNode == null || typeAttrNode.getValue().equals(
"text/javascript" ) );
}
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email