* fix: sanitize lone Unicode surrogates in snapshot and response serialization (#635) Pages with emoji/special characters can contain lone surrogates (e.g. \uD800 without a matching \uDC00-\uDFFF), causing serde_json to fail with "unexpected end of hex escape" when parsing the JSON response. - Add sanitizeSurrogates() to replace lone surrogates with U+FFFD in ariaSnapshot output - Add sanitizeJsonSurrogates() safety net in serializeResponse for other response fields (page.title, page.content, etc.) - Add tests for both sanitization paths Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: remove trivial "no surrogates unchanged" test Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * ci: retry flaky Rust test * refactor: remove unnecessary sanitizeSurrogates from snapshot.ts Chromium's ariaSnapshot() converts lone surrogates to literal text (e.g. the 6-char string "\ud800"), not actual surrogate code points. The real fix is sanitizeJsonSurrogates() in protocol.ts which handles eval and other response paths where actual surrogates appear. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: use toWellFormed() instead of regex for lone surrogate sanitization Upgrade tsconfig target/lib from ES2022 to ES2024 and replace the manual regex-based surrogate sanitization with String.prototype.toWellFormed(). This is simpler, more readable, and relies on the standard API. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: remove trivial no-surrogate test Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: hyunjinee <leehj0110@kakao.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
29 lines
521 B
JSON
29 lines
521 B
JSON
{
|
|
"compilerOptions": {
|
|
"target": "ES2024",
|
|
"module": "NodeNext",
|
|
"moduleResolution": "NodeNext",
|
|
"lib": [
|
|
"ES2024"
|
|
],
|
|
"outDir": "./dist",
|
|
"rootDir": "./src",
|
|
"strict": true,
|
|
"esModuleInterop": true,
|
|
"skipLibCheck": true,
|
|
"forceConsistentCasingInFileNames": true,
|
|
"declaration": true,
|
|
"declarationMap": true,
|
|
"sourceMap": true
|
|
},
|
|
"include": [
|
|
"src/**/*"
|
|
],
|
|
"exclude": [
|
|
"node_modules",
|
|
"dist",
|
|
"src/**/*.test.ts",
|
|
"opensrc"
|
|
]
|
|
}
|