Skip to content

feat(pseudo-classes): support :lang#1753

Merged
fb55 merged 2 commits intomasterfrom
lang
Mar 21, 2026
Merged

feat(pseudo-classes): support :lang#1753
fb55 merged 2 commits intomasterfrom
lang

Conversation

@fb55
Copy link
Copy Markdown
Owner

@fb55 fb55 commented Mar 21, 2026

Copilot AI review requested due to automatic review settings March 21, 2026 00:11
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for the Selectors Level 4 :lang() pseudo-class to the selector engine, addressing issue #1302 and enabling language-based matching via lang / xml:lang (with inheritance).

Changes:

  • Implement :lang(...) as a compiled filter, including RFC 4647 “extended filtering” semantics and ancestor language inheritance.
  • Add a dedicated :lang test suite covering exact match, prefix match, case-insensitivity, inheritance/override, comma-separated ranges, wildcard primary subtag, and xml:lang.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
test/pseudo-classes.ts Adds new test cases validating :lang() behavior across common and advanced matching scenarios.
src/pseudo-selectors/filters.ts Implements :lang filtering logic and RFC 4647 extended filtering helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fb55 fb55 merged commit b77508c into master Mar 21, 2026
13 checks passed
@fb55 fb55 deleted the lang branch March 21, 2026 00:37
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.

Add support for :lang pseudo-class

2 participants