Skip to content

fix: preserve source locations across multiline selector tokens - #376

Open
Aschenbath wants to merge 1 commit into
postcss:mainfrom
Aschenbath:fix/50-selector-multiline-locations-20261125-42bb
Open

Aschenbath wants to merge 1 commit into
postcss:mainfrom
Aschenbath:fix/50-selector-multiline-locations-20261125-42bb

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

Multiline comments report their ending line as their starting line. Escaped line continuations in quoted attribute values do not advance the tokenizer's line counter, so subsequent nodes and atPosition() lookups use the wrong line.

Preserve the original start line for comments and strings, and advance string end positions and the next token's column offset across line breaks. Selector text is preserved. New tests check comment bounds and position lookups as well as the location of a selector after a continued attribute value.

Validation: both regression cases fail on the original source. All 1,078 tests pass with the fix, including the coverage gate, type checks, lint, and formatting checks.

AI assistance: implemented and tested with OpenAI Codex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant