fix: don't uglify non-js script elements

i.e. when a script is being used for a template holder. So we use the `type` attribute check to be sure.

Fixes #68
This commit is contained in:
Remy Sharp 2015-11-26 19:46:25 +00:00
parent 0917c29ad4
commit a2a3e95607

View File

@ -8,11 +8,16 @@ function resolve(inliner, todo, $) {
return todo.map(function scripts(script) {
var $script = $(script);
var src = $script.attr('src');
var type = $script.attr('type');
var source = $script.text();
var promise;
var isMinified = false;
if (type && type.toLowerCase() !== 'text/javascript') {
return false;
}
// ext script
if (src) {
isMinified = src.indexOf('.min.') !== -1;