fix: relative urls

This commit is contained in:
Remy Sharp 2015-07-26 23:05:40 +01:00
parent 8dfea139c8
commit 96d7bf2fe3
2 changed files with 4 additions and 2 deletions

View File

@ -4,8 +4,8 @@ var cheerio = require('cheerio');
var debug = require('debug')('inliner');
function findAssets(html) {
debug('loading DOM');
var $ = cheerio.load(html);
debug('loaded DOM');
var images = $('img');

View File

@ -101,6 +101,8 @@ function main() {
url = 'http://' + url;
}
inliner.url = url;
debug('loading url: %s', url);
return get(url);
@ -174,7 +176,7 @@ function main() {
return Promise.all(promises).then(function then() {
var html = '';
var els = inliner.removeComments($(':root')[0], $);
inliner.removeComments($(':root')[0], $);
// collapse the white space
if (inliner.options.collapseWhitespace) {
// TODO put white space helper back in