Skip to content

Commit

Permalink
fix: use inlineCss options from config
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Oct 20, 2022
1 parent 0c6d9e9 commit 876ce9a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/transformers/inlineCss.js
Expand Up @@ -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)

Expand All @@ -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
}
Expand Down

0 comments on commit 876ce9a

Please sign in to comment.