Skip to content

Commit

Permalink
Added 'type="text/css"' to the style tags generated by filters.
Browse files Browse the repository at this point in the history
  • Loading branch information
reedriley committed Sep 19, 2011
1 parent 9b028ba commit 419827c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/filters.js
Expand Up @@ -22,7 +22,7 @@ module.exports = {
sass: function(str){
str = str.replace(/\\n/g, '\n');
var sass = require('sass').render(str).replace(/\n/g, '\\n');
return '<style>' + sass + '</style>';
return '<style type="text/css">' + sass + '</style>';
},

/**
Expand All @@ -37,19 +37,19 @@ module.exports = {
if (err) throw err;
ret = css.replace(/\n/g, '\\n');
});
return '<style>' + ret + '</style>';
return '<style type="text/css">' + ret + '</style>';
},

/**
* Transform sass to css, wrapped in style tags.
* Transform less to css, wrapped in style tags.
*/

less: function(str){
var ret;
str = str.replace(/\\n/g, '\n');
require('less').render(str, function(err, css){
if (err) throw err;
ret = '<style>' + css.replace(/\n/g, '\\n') + '</style>';
ret = '<style type="text/css">' + css.replace(/\n/g, '\\n') + '</style>';
});
return ret;
},
Expand Down Expand Up @@ -89,4 +89,4 @@ module.exports = {
var js = require('coffee-script').compile(str).replace(/\n/g, '\\n');
return '<script type="text/javascript">\\n' + js + '</script>';
}
};
};

0 comments on commit 419827c

Please sign in to comment.