-
Notifications
You must be signed in to change notification settings - Fork 17
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
cssesc always escapes identifier characters above U+00A0 #8
Comments
This suggestion goes against the goal of this library:
To only escape what’s absolutely necessary for modern browsers, you could use That said, cssesc could have an option to opt-in to similar behavior. If someone submits a patch, I’ll consider it. |
Indeed, including high characters should be an off-by-default option if provided at all. As for |
I would like to have this option and will make a PR for it. The polyfil does not optimize string escapes, and I feel this library is a better place to have both capabilities so that a single dependency can accommodate libraries that need to handle a range of browser support preferences from users. Do you have any preference for the option name (and corresponding CLI switch)? I suggest one of the following (in order of my most preferred to least preferred):
|
I'd prefer the name |
As is not demonstrated by the online demo at https://mothereff.in/css-escapes.
If a
@charset "utf-8";
directive is present in the input, or an appropriate option is set in the options object, it would be nice to be able to preserve characters that don't need to be escaped.The CSS 2.1 spec allows identifiers to contain characters above U+00A0, and at least CSS 2.0 allowed characters "161 and higher".
The text was updated successfully, but these errors were encountered: