Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

# kills page render #21

Closed
mrfrase3 opened this issue Jul 16, 2019 · 2 comments
Closed

# kills page render #21

mrfrase3 opened this issue Jul 16, 2019 · 2 comments

Comments

@mrfrase3
Copy link
Contributor

mrfrase3 commented Jul 16, 2019

say we have some css in our html

<style>
html {
  color: #aabbcc
}
</style>

and that is fed to this

  await page.goto(`data:text/html,${html}`, {

the # is read as a hash in a uri, causing it to only render the html up to that character.

replacing that line with

  await page.goto(`data:text/html;base64,${Buffer.from(html).toString('base64')}`, {

fixes the issue. (sending the uri as base64 instead)

mrfrase3 added a commit to mrfrase3/pdf-puppeteer that referenced this issue Jul 16, 2019
this prevents invalid URI characters from messing with page rendering, as seen in westmonroe#21
@cr7boulos
Copy link
Collaborator

@mrfrase3 Thanks for submitting this issue and the associated PR. We will review and get back to you shortly.

@cr7boulos
Copy link
Collaborator

@mrfrase3

This has been merged in and published in the latest version on npm.

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

No branches or pull requests

2 participants