Skip to content

Commit

Permalink
Fix CloudFlare link
Browse files Browse the repository at this point in the history
  • Loading branch information
mashedkeyboard committed Oct 28, 2023
1 parent d34ebc8 commit f4432db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion posts/2023/10/27/how-to-build-a-blog-the-hard-way.svx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ I have a reMarkable 2 e-ink tablet: I find it super handy for notetaking, and I

Typed documents on the reMarkable can be exported either as a PDF, a PNG, an SVG, or as text in an email: the SVG option exports the text as paths, so it looks like the reality pretty strongly favoured doing some parsing of the text in the email. Fortunately, it's sent as HTML, and HTML that's produced in a pretty regular format. So, that should be pretty easy to parse in, right?

Unfortunately, the challenge here was Workers' lack of support for DOM parsing. The Workers runtime is built around the idea of rewariting origin responses in real time, and for very valid technical reasons that [Cloudflare discuss in detail in a blog post connected to their HTMLRewriter API](https://blog.cloudflare,com/introducing-htmlrewriter), doing full DOM parsing in that process is all but impossible. This does, though, mean that in contexts like this one, where really that's what would make most sense, that processing has to be offloaded elsewhere. Other projects like [losfair's notion-fetch](https://github.com/losfair/notion-fetch) implemented this by building their DOM parser in another language, compiling to WebAssembly and then running that: for me, though, that seemed like a lot of overhead for this specific application, and I just shoved that unit of work into the GitHub Action that the Worker calls.
Unfortunately, the challenge here was Workers' lack of support for DOM parsing. The Workers runtime is built around the idea of rewariting origin responses in real time, and for very valid technical reasons that [Cloudflare discuss in detail in a blog post connected to their HTMLRewriter API](https://blog.cloudflare.com/introducing-htmlrewriter), doing full DOM parsing in that process is all but impossible. This does, though, mean that in contexts like this one, where really that's what would make most sense, that processing has to be offloaded elsewhere. Other projects like [losfair's notion-fetch](https://github.com/losfair/notion-fetch) implemented this by building their DOM parser in another language, compiling to WebAssembly and then running that: for me, though, that seemed like a lot of overhead for this specific application, and I just shoved that unit of work into the GitHub Action that the Worker calls.

## The end result

Expand Down

0 comments on commit f4432db

Please sign in to comment.