Fixed bug where printf control characters were causing JS inlining to break, i.e. console.log('12%d') => 12NaN instead of compressed to 12%d - was affecting people including jQuery minified.

This commit is contained in:
remy 2011-06-11 17:16:08 +01:00
parent 52b8f70a58
commit 78204a7f21
3 changed files with 6 additions and 5 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/env node
var path = require('path'), fs = require('fs'), querystring = require('querystring');
var path = require('path'), fs = require('fs'), querystring = require('querystring'), util = require('util');
fs.realpath(__filename, function(error, script) {
var servedir, root, port;
@ -109,13 +109,14 @@ fs.realpath(__filename, function(error, script) {
body += chunk;
});
res.on('end', function () {
console.log(body);
util.print(body);
});
});
request.write(data);
request.end();
} else {
console.log(html);
// using util.print because console.log evalutes sprintf commands - which we don't want to do
util.print(html);
}
});

View File

@ -515,7 +515,7 @@ if (!module.parent) {
}
var inliner = new Inliner(process.argv[2], options, function (html) {
console.log(html);
require('util').print(html);
});
})();
}

View File

@ -1,6 +1,6 @@
{
"name": "inliner",
"version": "0.1.5",
"version": "0.1.6",
"description": "Utility to inline images, CSS and JavaScript for a web page - useful for mobile sites",
"homepage": "http://github.com/remy/inliner",
"main": "inliner",