-
Notifications
You must be signed in to change notification settings - Fork 3.4k
compile font-family name with unicode is something wrong #3160
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
Comments
It looks like it fails to parse foo: bar, \5B8B\4F53; // ok
foo: 'bar', \5B8B\4F53; // error
foo: '' \5; // error A workaround is obviously to put unicode-symbols into quotes too (even if it's not required by the standard in this case), e.g.: foo: 'bar', '\5B8B\4F53'; // ok |
very thanks for your response my workflow is less(x.less) => x.css
cssnano(x.css)=> x-min.css if i add single quote like foo: 'bar', '\5B8B\4F53' less is ok, but if i pass foo: 'bar', '\5B8B\4F53' to cssnano, cssnano compress result is foo: 'bar', \\5B8B\4F53 cssnano will remove quote and add a redundant slash i tried only foo: 'bar', \5B8B\4F53 cssnano work ok so , i have no idea how to solve this . 😂 |
If it's Less code only (i.e. you're not planning to pass it somewhere w/o compilation), the standard workaround for any kind of such problems is escaping (which is basically meant to make Less to pass an arbitrary code through w/o parsing). I.e.: foo: 'bar', ~'\5B8B\4F5'; |
By the way:
In investigating, I found there actually is no support for escaping in keywords. It doesn't seem to have anything to do with quotes. There should be support though. I'm wondering if this should be tagged as a feature request? It could also stay a bug since escaping is valid CSS. In fiddling around, I was able to get this to pass just by allowing the backslash in keywords (plus alpha characters, |
This is definitely a bug. CSS should allow escaped characters in anything that is classified as an identifier. That classification is much wider than the names of font families. It also includes things like the names used for counters; keyframes; etc. |
@rjgotten Not in the traditional sense. By saying it's a feature request, I don't mean it's not an obvious thing to include. I just mean that Less appears to have never had support for escaped characters in identifiers. Hence it can't be a bug, because nothing was ever there. It's just a missing feature. (To clarify: if Less HAD support for escaped characters in identifiers, but it was working incorrectly, you'd traditionally file that as a bug. Either way, it's important to do.) |
Btw, this parsing no longer occurs as of Less 3.7. Not because escaping is supported, per se, but because of permissive parsing. Meaning: unknown chars get interpreted as a permissive value until closing |
I have a css rule like this
if i save it to x.less and use less to compile the file
less tell me
is there i miss something?
The text was updated successfully, but these errors were encountered: