From 876ce9ad8a354903e57344ce9b05577f78e9a51f Mon Sep 17 00:00:00 2001 From: Cosmin Popovici Date: Thu, 20 Oct 2022 13:42:41 +0300 Subject: [PATCH] fix: use inlineCss options from config --- src/transformers/inlineCss.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/transformers/inlineCss.js b/src/transformers/inlineCss.js index 8794315f..f33483a5 100644 --- a/src/transformers/inlineCss.js +++ b/src/transformers/inlineCss.js @@ -7,6 +7,8 @@ module.exports = async (html, config = {}, direct = false) => { } const options = direct ? config : get(config, 'inlineCSS', {}) + // Default `removeStyleTags` to false so we can preserve + // CSS selectors that are not present in the HTML const removeStyleTags = get(options, 'removeStyleTags', false) const css = get(config, 'customCSS', false) @@ -28,7 +30,9 @@ module.exports = async (html, config = {}, direct = false) => { }) } - html = css ? juice.inlineContent(html, css, {removeStyleTags}) : juice(html, {removeStyleTags}) + html = css ? + juice.inlineContent(html, css, {removeStyleTags, ...options}) : + juice(html, {removeStyleTags, ...options}) return html }