marp-team / marp-cli

A CLI interface for Marp and Marpit based converters
MIT License
1.85k stars 105 forks source link

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

Closed yhatt closed 11 months ago

yhatt commented 11 months ago

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().