Skip to content

Match CSS attribute selector values before retaining attributes - #2248

Open
Neallin-917 wants to merge 1 commit into
svg:mainfrom
Neallin-917:neallin-917-fix-2145-attr-selector-match
Open

Match CSS attribute selector values before retaining attributes#2248
Neallin-917 wants to merge 1 commit into
svg:mainfrom
Neallin-917:neallin-917-fix-2145-attr-selector-match

Conversation

@Neallin-917

Copy link
Copy Markdown

Fixes #2145

includesAttrSelector now evaluates CSS attribute selector operators against the current attribute value. The callers in inlineStyles and removeUnknownsAndDefaults now provide that value, so selectors that cannot match no longer keep a redundant attribute.

Added unit coverage for supported operators and regressions for both affected plugins.

Validation:

  • full Jest suite: 494 passed, 3 skipped
  • ESLint and Prettier
  • type checks, tsd, and bundle build
  • bundled-browser test

AI assistance: this patch was AI-assisted and the listed validations were run locally.

@Neallin-917
Neallin-917 marked this pull request as ready for review August 13, 2026 02:43
@Neallin-917
Neallin-917 force-pushed the neallin-917-fix-2145-attr-selector-match branch from 7f6744a to 2523117 Compare August 14, 2026 13:46
@Neallin-917

Copy link
Copy Markdown
Author

Friendly follow-up: this is a focused fix for CSS attribute-selector values being matched before attributes are retained, with a regression fixture covering quoted and escaped values. It was validated with the project's QA suite. I would appreciate a maintainer review when convenient, and I am happy to adjust the approach if needed. Thank you.

@Neallin-917
Neallin-917 force-pushed the neallin-917-fix-2145-attr-selector-match branch from 2523117 to c58705b Compare August 30, 2026 02:05
@Neallin-917

Copy link
Copy Markdown
Author

I rebased this focused change onto current main after confirming the earlier CI failure came from the prior base’s regression-test dependency state, outside this PR’s diff. Local pnpm run qa now passes (523 tests passed, 3 skipped). The new GitHub Actions runs are currently marked action_required before any jobs start; could a maintainer approve them when convenient? Thank you.

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.

includesAttrSelector: support different equality checks in attribute selectors too

1 participant