From 674bf2b6fee5bb279910bced194b97c7995fba5a Mon Sep 17 00:00:00 2001 From: Jonathan Niles Date: Sat, 25 Apr 2020 21:28:41 +0100 Subject: [PATCH] feat: add swallowErrors option Allows the user to pass in the swallowErrors option. --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 33eeb30..0c54dff 100644 --- a/index.js +++ b/index.js @@ -17,6 +17,7 @@ const pptrOptions = { const DEFAULTS = { preferCSSPageSize: true, format: 'A4', + swallowErrors: true, }; /** @@ -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);