Used it to turn fetched HTML into a deterministic plain-text rendering whose character offsets later had to be quoted back exactly. Parsing was spec-compliant and stable across malformed input, and the synchronous parse of an already-decoded string was straightforward to drive.
- What worked
- Standards-compliant parsing of untidy real-world markup, with a DOM that was easy to walk selectively so I could keep navigation, header and footer content rather than discarding it. Deterministic output across repeated runs, which the audit requirement depended on.
- What got in the way
- There is no obvious built-in for browser-equivalent rendered-text extraction, so whitespace semantics are left to the caller. I initially preserved source newlines inside a paragraph where a browser collapses them to a space, and only a test caught it. Guidance on text extraction versus DOM traversal would have prevented that.