Handle attribute string errors and escaped line continuations - #198
Merged
Conversation
jdalton
force-pushed
the
fix/attribute-parse-error
branch
from
September 5, 2026 16:13
8b58bf6 to
f65d449
Compare
This was referenced Sep 5, 2026
jdalton
force-pushed
the
fix/attribute-parse-error
branch
from
September 5, 2026 22:55
f65d449 to
a6dbae3
Compare
jdalton
force-pushed
the
fix/attribute-parse-error
branch
2 times, most recently
from
September 6, 2026 02:30
0f39244 to
c4b0eb3
Compare
jdalton
force-pushed
the
fix/attribute-parse-error
branch
from
September 6, 2026 03:02
c4b0eb3 to
3c512c7
Compare
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.
Tooling update
Rebased onto merged #212 as one commit. Sources and tests use
.mts, Node tests use Vitest, and the published JavaScript paths stay unchanged. The original engine changes are preserved.Local lint, formatting, Node and packed-package checks pass. All 41 WPT pages pass against both generated builds.
Change
Handle failed attribute matches through the normal syntax-error path and support escaped line continuations in quoted strings.
This follows the end-of-input discussion on #179. A backslash followed by LF, CR, CRLF or form feed continues a CSS string. A raw newline does not.
The parser consumes continuations before whitespace normalization, preserves hex-escape boundaries, and keeps valid end-of-input recovery. It rejects raw newlines, including form feed and a newline at the end of an unclosed string. Tag-prefixed
match()calls no longer silently lose the invalid suffix.The four former TODO cases are now ordinary passing tests. Validation:
Run
pnpm run test:attributes. For native-browser comparison, install Chromium and runpnpm run test:attributes:browser. Seetest/attribute-parse-error.mdfor details. One commit.