Skip to content

Commit

Permalink
feat: add swallowErrors option
Browse files Browse the repository at this point in the history
Allows the user to pass in the swallowErrors option.
  • Loading branch information
jniles committed Apr 25, 2020
1 parent 2824465 commit 674bf2b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const pptrOptions = {
const DEFAULTS = {
preferCSSPageSize: true,
format: 'A4',
swallowErrors: true,
};

/**
Expand All @@ -39,7 +40,9 @@ async function render(html, options = {}) {

let inlined = html;
if (!options.skipRendering) {
inlined = await inlineSource(html, { attribute: false, rootpath: '/', compress: false });
inlined = await inlineSource(html, {
attribute: false, rootpath: '/', compress: false, swallowErrors: opts.swallowErrors,
});
}

browser = await pptr.launch(pptrOptions);
Expand Down

0 comments on commit 674bf2b

Please sign in to comment.