Fix serializer roundtrip bugs for raw text and plaintext elements
Bug fixes found via property-based fuzzing with Crowbar:
1. Raw text element escaping: Text content inside <script>, <style>,
<iframe>, <xmp>, <noembed>, <noframes>, and <noscript> was being
HTML-escaped during serialization, causing double-escaping on each
roundtrip. Fixed by detecting raw text elements and outputting
their content without escaping.
2. Escapable raw text elements: <textarea> and <title> content should
only have & escaped, not < or >. Added separate handling for these.
3. Plaintext element serialization: <plaintext> content accumulated
closing tags on each roundtrip because any content after plaintext
gets absorbed into its content on reparse. Fixed by:
- Not outputting closing tag for plaintext
- Propagating "plaintext encountered" flag through serialization
- Stopping serialization of closing tags for ancestors once
plaintext is found
Also adds fuzz/ directory with comprehensive Crowbar-based property
tests covering crash resistance, roundtrip stability, selector
parsing, DOM manipulation, and more.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>