Hacker News new | ask | show | jobs
by harshreality 1021 days ago
HTML and various javascript libraries like mathjax or other libraries for charts and graphs.

> Doesn't seem like HTML would fly, either, given all the kinds of things that get embedded into PDF.

That's ironic. Browser PDF readers, at least open source ones, render PDFs as HTML using javascript. At least I'm sure about FF because I just checked that text from a native-digital pdf showed up in the DOM in developer tools.

1 comments

> HTML and various javascript libraries like mathjax or other libraries for charts and graphs.

How do you email that to someone as an attachment? Can you embed all of that stuff into a single .html file?

Sure, epub.

You could (or maybe you can't, but ebook readers should allow you to) disable any network access without explicit confirmation, so the javascript can't do anything evil other than modify the ebook being displayed. If you can't do that, that's up to ebook readers to solve, and not a flaw with epubs.

> Can you embed all of that stuff into a single .html file?

Technically yes, but there are two problems.

First is that inline style and scripts are a potential security vulnerability.

Second is that if someone does not inline everything and instead references css/js from the web the document will stop rendering correctly when those resources go offline.