mirror of
https://github.com/remy/inliner.git
synced 2024-09-11 17:25:30 +03:00
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:
parent
52b8f70a58
commit
78204a7f21
@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -515,7 +515,7 @@ if (!module.parent) {
|
||||
}
|
||||
|
||||
var inliner = new Inliner(process.argv[2], options, function (html) {
|
||||
console.log(html);
|
||||
require('util').print(html);
|
||||
});
|
||||
})();
|
||||
}
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user