Skip to content

fix: preserve explicitly empty raw property spellings - #379

Open
Aschenbath wants to merge 1 commit into
postcss:mainfrom
Aschenbath:fix/oss-20-round4-20261125-77d1-selector-empty-raw
Open

Aschenbath wants to merge 1 commit into
postcss:mainfrom
Aschenbath:fix/oss-20-round4-20261125-77d1-selector-empty-raw

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

An explicitly empty raw property is currently discarded: suppressing a comment with setPropertyAndEscape("value", comment.value, "") still serializes the comment, and appending to an empty raw spelling restores the hidden original text. Preserve that explicit spelling in stringifyProperty and appendToPropertyAndEscape. Lossy parsing leaves the raw descendant-combinator value absent when it has no spelling to preserve, so necessary spaces retain their existing output.

Added seven tests covering serialization, cloning, appending, clearing an override, absent raw values, and lossy descendant spacing. Four regressions fail against unchanged main; the three compatibility cases pass. npm test passes all 1,083 tests, including lint, declarations, build, and coverage thresholds. Changed-file formatting and git diff --check pass. The full formatting check has existing failures in unchanged exceptions.mjs and pseudos.mjs, reproduced on the original base.

Developed with OpenAI Codex assistance and independently reviewed against the tested file hashes.

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