Skip to content

Commit

Permalink
feat: allow external source to skip rendering
Browse files Browse the repository at this point in the history
Allows the exterior module to skip rendering the HTML.
  • Loading branch information
jniles committed Apr 25, 2020
1 parent 115e4e9 commit 2824465
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ async function render(html, options = {}) {
let browser;
try {
const opts = { ...options, ...DEFAULTS };
const inlined = await inlineSource(html, { attribute: false, rootpath: '/', compress: false });


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

browser = await pptr.launch(pptrOptions);
const page = await browser.newPage();
await page.setContent(inlined.trim());
Expand Down

0 comments on commit 2824465

Please sign in to comment.