Skip to content

Conversation

@jtheberge
Copy link

Problem

The inlineContent and inlineDocument functions were not applying default options correctly. This meant that when users called juice.inlineContent(html, css) or juice.inlineContent(html, css, {}), for example, they wouldn't get expected default behaviors defined in lib/utils.js.

Solution

Modified inlineDocument to call utils.getDefaultOptions(options), ensuring all client entry points properly merge provided options with defaults. This makes the behavior consistent with juiceDocument which already applied defaults here.

Breaking changes

If you need the old behavior (no defaults applied), explicitly pass options to disable all truthy defaults:

juice.inlineContent(html, css, {
  insertPreservedExtraCss: false,
  applyStyleTags: false,
  removeStyleTags: false,
  preserveMediaQueries: false,
  preserveFontFaces: false,
  preserveKeyFrames: false,
  preservePseudos: false,
  applyWidthAttributes: false,
  applyHeightAttributes: false,
  applyAttributesTableElements: false,
  resolveCSSVariables: false
});

as well as for inlineDocument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant