You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(browser): the HTML serializer's raw-text elements differ from the HTML rule #288
The browser crate's HTML serializer (crates/crawlberg-browser/src/dom/serialize.rs:138) uses a raw-text element set that differs from the HTML serialization rule: xmp, iframe, noembed, noframes and plaintext are missing (their text should be written unescaped), and title and textarea are in the set although their text should be escaped. A rendered page's serialized HTML can therefore differ from what a browser would serialize. Found while reviewing #232; not yet reproduced with a page.
Fix
Match the serializer's raw-text set to the HTML fragment serialization algorithm and add a round-trip test per element.
#511 shows the effect of the title and textarea half: the serializer writes text such as </title><a href="/evil"> unescaped, so the HTML that crawlberg extracts from gains an extra link after the reparse. The native backend reaches this on every render.
Activity
tobocop2 commentedon Oct 1, 2026
#511 shows the effect of the
titleandtextareahalf: the serializer writes text such as</title><a href="/evil">unescaped, so the HTML that crawlberg extracts from gains an extra link after the reparse. The native backend reaches this on every render.fix(browser): follow HTML raw-text serialization rules (#288)
Goldziher commentedon Oct 4, 2026
Implemented, reviewed, and pushed to main in the dependency-upgrade/fix series ending at 56d093a.