Repository navigation
fix: decode quoted attribute line continuations - #353
Draft
Huzaifa-Asif wants to merge 1 commit into
Draft
Huzaifa-Asif wants to merge 1 commit into
Huzaifa-Asif wants to merge 1 commit into
Conversation
Preserve CSS string semantics when decoding and rewriting quoted attribute values. Add line continuation and escape boundary regression tests. AI assistance was used for implementation, testing and independent automated review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Quoted attribute values currently retain escaped line breaks in their decoded
value. Reading and assigning that value changes the selector's meaning:[title="afollowed by a backslash, newline, andb"]matchestitle="ab", but the rewritten selector matches a value containing a newline.Consume LF, CRLF, CR, and form-feed continuations when decoding quoted attribute strings, as specified by CSS string tokenization and input preprocessing. Keep original raw text for unchanged selectors. Add tests for both quote styles, value rewriting, escaped backslashes, and ordinary/hexadecimal escapes; correct the existing newline expectation to the decoded CSS value.
Validation on Node 24.18.1:
npm test: all 921 tests pass, including lint, declaration typecheck, build, and coverage thresholds (95.14% lines, 95.70% branches, 97.74% functions). Lint reports the same two pre-existing warnings inexceptions.mjs.title="ab", across both quote styles and all four newline encodings.git diff --checkpass. Existing TypeScript 5.9.3, oxlint 1.78.0, and PostCSS 8.5.28 installations were reused; dependencies and lockfiles are unchanged.AI assistance was used to investigate, implement, and test this change.