From 68a0bc8e88bc3271664fedb3ce272c743c26d8da Mon Sep 17 00:00:00 2001 From: remy Date: Sat, 11 Jun 2011 17:51:04 +0100 Subject: [PATCH] Fixed style elements with direct descendant selectors being stripped, ie. body > * { foo: bar} was being converted to: body*{foo:bar} - missing '>'. --- inliner.js | 6 ++---- package.json | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/inliner.js b/inliner.js index 483b42f..edbf5ac 100755 --- a/inliner.js +++ b/inliner.js @@ -119,7 +119,7 @@ function Inliner(url, options, callback) { } else { html = window.document.innerHTML; } - // console.log(html); + html = '' + html; callback && callback(html); inliner.emit('end', html); @@ -146,11 +146,10 @@ function Inliner(url, options, callback) { inliner.getImportCSS(root, this.innerHTML, function (css, url) { inliner.getImagesFromCSS(url, css, function (css) { if (inliner.options.compressCSS) inliner.emit('progress', 'compress inline css'); - style.innerHTML = css; + window.$(style).text(css); breakdown.styles--; inliner.todo--; - // console.log('style finished'); finished(); }); }); @@ -177,7 +176,6 @@ function Inliner(url, options, callback) { } window.$(link).replaceWith(style); - // console.log('link finished'); finished(); }); }); diff --git a/package.json b/package.json index 3a1447e..59211e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "inliner", - "version": "0.1.6", + "version": "0.1.7", "description": "Utility to inline images, CSS and JavaScript for a web page - useful for mobile sites", "homepage": "http://github.com/remy/inliner", "main": "inliner",