Skip to content

Commit

Permalink
Merge pull request alvarcarto#137 from tomasc/master
Browse files Browse the repository at this point in the history
output: :html to return full page (instead of body only)
  • Loading branch information
kimmobrunfeldt authored Mar 23, 2021
2 parents 218d391 + 8b31dd8 commit 4fd7b10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# CHANGELOG

* change the `:html` output to return `document.documentElement.innerHTML` instead of previously used `document.body.innerHTML`

## 1.0.0

* initial version
3 changes: 1 addition & 2 deletions src/core/render-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ async function render(_opts = {}) {
}
data = await page.pdf(opts.pdf);
} else if (opts.output === 'html') {
data = await page.evaluate(() => document.body.innerHTML);
data = await page.evaluate(() => document.documentElement.innerHTML);
} else {
// This is done because puppeteer throws an error if fullPage and clip is used at the same
// time even though clip is just empty object {}
Expand Down Expand Up @@ -248,4 +248,3 @@ function logOpts(opts) {
module.exports = {
render,
};

0 comments on commit 4fd7b10

Please sign in to comment.