Skip to content

Unicode matching #569

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

Closed
PookMook opened this issue Jul 6, 2017 · 5 comments
Closed

Unicode matching #569

PookMook opened this issue Jul 6, 2017 · 5 comments

Comments

@PookMook
Copy link

PookMook commented Jul 6, 2017

hi

Do you want to request a feature or report a bug?
bug

I encounter a problem with how css-loader handle unicode in my CSS file
What is the current behavior?

When i feed the unicode for "é" : \0000E9, the compiled css ends up being mimified but transformed so

div#download:before{
  display:block;
  content:"T\E9l\0000E9charger";
}

becomes :
div#download:before{display:block;content:"T\E9l\E9 charger le fichier YAML";text-align:center}
with two spaces after the unicode declaration which will display in the final page as "télé charger" instead of "télécharger"

I tried variations of it to see if I was missing something:
content:"T\E9l\E9charger"; => content:"T\E9l\E9Charger" =>" tél(accentued greek omega)harger"
content:"T\E9l\E9 charger"; => content:"T\E9l\E9 charger" with three spaces=> "télé charger"
content:"T\E9l\E9\000063harger"; => content:"T\E9l\E9 charger"; with two spaces => "télé charger"
content:"T\E9l\0000E9\000063harger"; => content:"T\E9l\E9 charger"; with two spaces => "télé charger"

What is the expected behavior?
the expected behavior would be to transform
content:"T\E9l\0000E9charger";
in
content:"T\E9l\E9 charger";
with only one space (to escape the unicode recognition, but not 2 as it is now that add an extra space in the final HTML render.

Please mention other relevant information such as your webpack version, Node.js version and Operating System.
I use

    "webpack": {
      "version": "2.6.1",
"css-loader": {
      "version": "0.28.4",
"font-awesome-webpack": {
      "dependencies": {
        "css-loader": {
          "version": "0.26.4",

and my rule for match css is

                test: /\.css$/,
                use: extractPlugin.extract({
                    use: ['css-loader']
                })

thanks

@alexander-akait
Copy link
Member

@PookMook maybe related to css-modules/css-selector-tokenizer#4

@PookMook
Copy link
Author

PookMook commented Jul 6, 2017

yes and no I think, this fail as well on the full unicode \0000E9, so unless this gets executed twice (from "\0000E9" to "\E9 " (with one space) then to "\E9 " (with two spaces), that shouldn't happen.

@alexander-akait
Copy link
Member

@PookMook seems i already found bug somewhere in the past https://github.com/webpack-contrib/css-loader/blob/master/test/simpleTest.js#L29
@TrySound what do your think about this? In past i rewrote css-loader from css-selector-tokenizer to postcss-value-parser (your repo 😄 ) and it is solve this problem (and some other), but for some reason, we rejected PR.

@alexander-akait
Copy link
Member

Close in favor #578 . Thanks!

@Yaowenjie
Copy link

@PookMook are you still having this issue? I met this as well, could you tell me what you did for it? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants