Cloudflare
Cloudflare logoCloudflare · Feature trail

HTML Parsing and Modification

2 posts · Sep 2016 – Feb 2023

What this trail covers

Cloudflare's HTML parsing and modification capabilities have evolved from a complex, difficult-to-maintain Ragel-based parser to a new, faster, and more maintainable streaming parser named cf-html (LOL HTML). This evolution aims to improve the efficiency and reliability of features that modify HTML on the fly, such as email obfuscation, server-side excludes, and automatic HTTPS rewrites. The transition to cf-html is ongoing, with a focus on migrating all functionalities to the new parser. The HTML parser bug that caused memory leaks has been fixed by addressing pointer errors in the Ragel implementation and ensuring proper buffer handling, particularly at the end of buffers and in error conditions.

All Cloudflare trails