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

Render HTML via Page.setContent() instead of data URI #551

Merged
merged 2 commits into from
Sep 23, 2023

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Sep 23, 2023

In a huge Markdown document, the encoded slide HTML may reach to the limit of data URI length.

I updated how to render a HTML for conversion to use Puppeteer's Page.setContent(). Resolves #545.

about:, the scheme of the default page about:blank after browser.newPage() is Chrome internal scheme, so it may be insecure because about: can access to some Chrome-internal resources provided by other about: pages. We should keep a secure scheme data: by going to the empty HTML page data:text/html, before rendering HTML through Page.setContent().

In a huge Markdown document, the slide document HTML may reach to the
limit of data URI length.
@yhatt yhatt merged commit d82fd0f into main Sep 23, 2023
1 check passed
@yhatt yhatt deleted the bugfix-large-file-conversion branch September 23, 2023 19:53
yhatt added a commit that referenced this pull request Sep 24, 2023
As same as #551, the preview window may fail to open data URI due to the
limitation of the display length.. If passed data URI to the preview
window, Marp CLI try to convert to Blob URL and open it instead.
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

Successfully merging this pull request may close these issues.

Generation of PDF failed with too much latex formulas
1 participant