Skip to content

fix(rules): handle comments in CSS declarations - #906

Merged
nc9 merged 2 commits into
squirrelscan:mainfrom
WilliamK112:codex/hidden-text-css-comments-896
Oct 17, 2026
Merged

nc9 merged 2 commits into
squirrelscan:mainfrom
WilliamK112:codex/hidden-text-css-comments-896

Conversation

@WilliamK112

Copy link
Copy Markdown
Contributor

Summary

  • replace CSS comments with token-separating whitespace while reading declaration blocks
  • recognize properties when comments appear before the name or before the colon
  • cover stylesheet and inline hidden-text findings plus value token separation

Testing

  • bun test packages/rules/tests/hidden-text.test.ts (153 passed)
  • bun test packages/rules/tests (6777 passed, 25 existing todo, 0 failed)
  • bun run --filter @squirrelscan/rules typecheck

Closes #896

@nc9
nc9 merged commit 0342151 into squirrelscan:main Oct 17, 2026
15 checks passed
@nc9

nc9 commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Thanks @WilliamK112! content/hidden-text now sees display: none even when a CSS comment sits before the property or its colon, in stylesheets and inline styles, so text hidden that way gets reported. Really appreciate it.

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.

content/hidden-text misses display:none when a CSS comment precedes the property

2 participants