mirror of
https://github.com/hanzoai/swc.git
synced 2026-10-30 19:42:53 +00:00
**Description:** Preserve JSON `script` element boundaries during HTML minification. The JSON serializer normalizes Unicode escapes, which can turn escaped less-than signs into literal characters and change how the HTML parser delimits the containing element. Re-escape less-than signs after serialization so the minified document retains the same element structure. Add fixture coverage for encoded element-like content. **Related issue (if exists):** None. **Verification:** - `cargo test -p swc_html_minifier` - `cargo fmt --all` - `cargo clippy --all --all-targets -- -D warnings`