3 ms·
Probably not without constructing a DOM. Which nowadays, in practice, means using Blink or WebKit.
by mh- 4y ago
Probably not without constructing a DOM. Which nowadays, in practice, means using Blink or WebKit.
- yencabulator 4y agohttps://github.com/cloudflare/lol-html https://github.com/cloudflare/lol-html is a HTML rewriter that explicitly does not construct DOM or an AST, but streams nodes throughs ASAP. https://blog.cloudflare.com/html-parsing-1/ https://blog.cloudflare.com/html-parsing-1/ https://blog.cloudflare.com/html-parsing-2/ https://blog.cloudflare.com/html-parsing-2/
- mh- 4y agoThis is the best approach if they don't need to consider client-side JS mutations. Not sure why I interpreted it that way in my original reply. Thanks!