handlebars-loader
handlebars-loader copied to clipboard
remove whitespaces
i'd like to add this code to line 172 to remove whitespaces. this will remove preceding and trailing white spaces.
if (!!query.removeWhiteSpace) {
source = source.replace(/^[\s\uFEFF\xA0\x20\t]+|[\s\uFEFF\xA0\x20\t]+$/mg, ' ').replace(/[\r\n]/mg, '');
}
Looking for the same.
Would maybe propose a "processcontent" option as in https://github.com/gruntjs/grunt-contrib-handlebars#processcontent
options: {
processContent: function(content, filepath) {
return content.replace(/^[\s\uFEFF\xA0\x20\t]+|[\s\uFEFF\xA0\x20\t]+$/mg, ' ').replace(/[\r\n]/mg, '');
}
}