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

Add escape function to escape CSS identifiers #125

Closed
facelessuser opened this issue Mar 16, 2019 · 0 comments
Closed

Add escape function to escape CSS identifiers #125

facelessuser opened this issue Mar 16, 2019 · 0 comments
Labels
C: API Related to the API. T: feature Feature.
Milestone

Comments

@facelessuser
Copy link
Owner

facelessuser commented Mar 16, 2019

From the spec:

  • If the character is NULL (U+0000), then the REPLACEMENT CHARACTER (U+FFFD).
  • If the character is in the range [\1-\1f] (U+0001 to U+001F) or is U+007F, then the character escaped as code point.
  • If the character is the first character and is in the range [0-9] (U+0030 to U+0039), then the character escaped as code point.
  • If the character is the second character and is in the range [0-9] (U+0030 to U+0039) and the first character is a "-" (U+002D), then the character escaped as code point.
  • If the character is the first character and is a "-" (U+002D), and there is no second character, then the escaped character.
  • If the character is not handled by one of the above rules and is greater than or equal to U+0080, is "-" (U+002D) or "_" (U+005F), or is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to U+005A), or [a-z] (U+0061 to U+007A), then the character itself.
    Otherwise, the escaped character.
@facelessuser facelessuser added T: feature Feature. C: API Related to the API. labels Mar 16, 2019
facelessuser added a commit that referenced this issue Mar 17, 2019
facelessuser added a commit that referenced this issue Mar 17, 2019
facelessuser added a commit that referenced this issue Mar 17, 2019
facelessuser added a commit that referenced this issue Mar 17, 2019
facelessuser added a commit that referenced this issue Mar 18, 2019
* Add CSS escape function
Closes #125

* Add some tests
@facelessuser facelessuser added this to the 1.9.0 milestone Mar 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: API Related to the API. T: feature Feature.
Projects
None yet
Development

No branches or pull requests

1 participant