Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow CSS level 3 selectors for classes and ids in the attributes extension #1013

Open
wants to merge 2 commits into
base: 2.4
Choose a base branch
from

Conversation

xavierlacot
Copy link

The CSS level 3 Syntax, which is a Recommendation since 2018, allows much more characters in id and class selectors than the ones currently supported by the "Attributes" extension:

private const SINGLE_ATTRIBUTE = '\s*([.#][_a-z0-9-]+|' . RegexHelper::PARTIAL_ATTRIBUTENAME . RegexHelper::PARTIAL_ATTRIBUTEVALUESPEC . ')\s*';

The formal CSS level 3 selectors grammar is detailed here: https://www.w3.org/TR/selectors-3/#w3cselgrammar

This pull request adds a test to check several valid class and id names that are currently failing to be parsed as valid attribute values by the "Attributes" extension, and it proposes a fix for this issue.

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.

None yet

1 participant