Skip to content

fix leading newlines for nested rules + fix trailing newlines for empty rules - #2

Merged
bartveneman merged 1 commit into
mainfrom
fix-nested-rules
Jun 15, 2023
Merged

fix leading newlines for nested rules + fix trailing newlines for empty rules#2
bartveneman merged 1 commit into
mainfrom
fix-nested-rules

Conversation

@bartveneman

Copy link
Copy Markdown
Member

closes #1

@bartveneman
bartveneman merged commit 8593824 into main Jun 15, 2023
@bartveneman
bartveneman deleted the fix-nested-rules branch June 15, 2023 21:58
bartveneman pushed a commit that referenced this pull request Jul 19, 2026
…rser 0.17.0

The rebase picked up @projectwallace/css-parser 0.16.0 -> 0.17.0,
which fixes the dotted-layer-name splitting bug (PARSER_ISSUES.md
issue #1) that previously made the standalone `@layer name;`
statement form fall back to the regex-based formatter. Removed that
bypass now that LayerName.text/.name correctly include the full
dotted name, and let it go through the same structured printing path
as everything else. PARSER_ISSUES.md updated to reflect the fix;
re-verified the remaining issues (#2, #3, #5, #6, #7) are still
present in 0.17.0, so their workarounds are unchanged.
bartveneman pushed a commit that referenced this pull request Jul 19, 2026
…em fixed

Renumbered the remaining issues (was #2-10, now #1-9) and updated
their cross-references. Fixed issues stay discoverable via git
history instead of accumulating as resolved clutter in the file.
bartveneman pushed a commit that referenced this pull request Jul 19, 2026
… in css-parser 0.18.1

Bumped @projectwallace/css-parser 0.18.0 -> 0.18.1, which fixes
three more PARSER_ISSUES.md entries:

- @supports selector(...) (and other function-token conditions) used
  to return an empty array; it's now deep-parsed into a real selector
  list. print_prelude_function now special-cases `selector()` to
  print via format_selector_list instead of the declaration-parsing
  path used for style()/other conditions, since a selector list isn't
  a declaration.
- The leading only/not media-query prefix used to be silently
  dropped from a query's children (though still present in the
  query's own .text). format-css's own regex-based workaround
  (ONLY_NOT_PREFIX_RE, extracting it from node.text and prepending
  it) is now removed, since only/not are real PreludeOperator
  children the existing generic dispatch already prints correctly -
  leaving the old workaround in place would have double-printed them
  ("only only screen") now that the upstream fix landed. Confirmed
  via differential testing against the previous commit that this
  would have been a real, silent regression.
- The .d.ts child-union mismatches on AtrulePrelude/ContainerQuery/
  FeatureRange are also fixed - no code change needed there, just
  removed from the docs.

Only issue #1 (=> tokenized as two operators) and #2 (no
comment-preservation hook) remain open in PARSER_ISSUES.md.

Added test coverage for both fixed behaviors (only/not prefix
round-tripping without duplication, @supports selector() printing as
a selector list rather than going through declaration formatting).
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.

Missing newline for nested Rule coming after Declaration

1 participant