minor fixes

This commit is contained in:
Ben Zörb 2016-04-17 23:46:58 +02:00
parent 125c1aa16f
commit 3a56a2d3e2

View File

@ -72,7 +72,8 @@ function getIndent(html, $el) {
}
module.exports = function (html, styles, options) {
var $ = cheerio.load(String(html), {
html = String(html);
var $ = cheerio.load(html, {
decodeEntities: false
});
@ -112,7 +113,7 @@ module.exports = function (html, styles, options) {
// insert inline styles right before first <link rel="stylesheet" />
$target.before([
'<style type="text/css">',
indent + styles,
indent + styles.replace(/(\r\n|\r|\n)/g,'$1' + targetIndent + indent),
'</style>', ''
].join('\n' + targetIndent));