From dd4f03257c607a55ac88aa8f4e0994292777e6ec Mon Sep 17 00:00:00 2001 From: Alexandre Gigliotti Date: Thu, 23 Jul 2015 16:58:12 -0700 Subject: [PATCH] Return decoded html. --- lib/inline-css.js | 2 +- lib/inline-img.js | 2 +- lib/inline-link-less.js | 2 +- test/fixtures/index.html | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/inline-css.js b/lib/inline-css.js index c942279..6c935bf 100644 --- a/lib/inline-css.js +++ b/lib/inline-css.js @@ -12,7 +12,7 @@ var unwrap = function (value) { return value.replace(regexp, '$1'); }; var inline = function (html, filePath) { - var $ = cheerio.load(html); + var $ = cheerio.load(html, {decodeEntities: false}); // style elements var styles = $('style'); diff --git a/lib/inline-img.js b/lib/inline-img.js index a12df5d..c7efc97 100644 --- a/lib/inline-img.js +++ b/lib/inline-img.js @@ -5,7 +5,7 @@ var path = require('path'); var inline = function (html, filePath) { var basedir = path.dirname(filePath); - var $ = cheerio.load(html); + var $ = cheerio.load(html, {decodeEntities: false}); var images = $('img').filter(function (index, element) { return isLocalPath($(element).attr('src')); }); diff --git a/lib/inline-link-less.js b/lib/inline-link-less.js index 2cca784..9711d9c 100644 --- a/lib/inline-link-less.js +++ b/lib/inline-link-less.js @@ -29,7 +29,7 @@ var inline = co.wrap(function * (html, filepath, options) { // TODO Import less links // get links - var $ = cheerio.load(html); + var $ = cheerio.load(html, {decodeEntities: false}); var links = $('link[rel="stylesheet/less"]') .filter(function (index, element) { return isLocalPath($(element).attr('href')); diff --git a/test/fixtures/index.html b/test/fixtures/index.html index 2312e79..b967eaa 100644 --- a/test/fixtures/index.html +++ b/test/fixtures/index.html @@ -19,5 +19,7 @@
Style
Attribute
Image + {{> partial}} + {{helper}} \ No newline at end of file