Skip to content

fix: escape generated CSS selectors#37

Merged
yusukebe merged 1 commit into
yusukebe:mainfrom
yearth:fix/selector-roundtrip
Jul 17, 2026
Merged

fix: escape generated CSS selectors#37
yusukebe merged 1 commit into
yusukebe:mainfrom
yearth:fix/selector-roundtrip

Conversation

@yearth

@yearth yearth commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • escape CSS-special class and ID tokens in selectors emitted by --outline and --locate
  • preserve the existing tag.class / tag#id output shape without adding a dependency
  • verify emitted selectors round-trip back into ax extraction

Motivation

Tailwind-style classes such as sm:w-1/2 currently produce selectors like div.sm:w-1/2, which fail when passed back to ax because : is parsed as a pseudo-class.

Tests

  • bun test (81 pass)
  • bun run format
  • bun run build

@yusukebe yusukebe left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yusukebe

Copy link
Copy Markdown
Owner

@yearth Thanks again!

@yusukebe
yusukebe merged commit 248878f into yusukebe:main Jul 17, 2026
1 check passed
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.

2 participants