Closed ttttmr closed 1 year ago
https://github.com/tdewolff/parse/blob/91901180122e1211ba489e7eac0ad991c0da38b2/css/parse.go#L235 https://github.com/tdewolff/parse/blob/91901180122e1211ba489e7eac0ad991c0da38b2/css/parse.go#L381
There are two ToLower calls here, which will modify the case of the original data when parsing
I don't think it should be modified, especially when the data is not css, some strings in the data may be modified after calling parse
You may need to use Copy like here https://github.com/tdewolff/parse/blob/91901180122e1211ba489e7eac0ad991c0da38b2/html/lex.go#L198
or simply delete this call (I am not very proficient in css, and I don't really understand why it needs to be lowercased here)
Thank, should be fixed now. Principally it's used to improve GZIP compression, but I've added Copy to avoid modifying the original.
Copy
Fixed in https://github.com/tdewolff/parse/commit/98cf927e40837df9e1a0536cb23c5c2e7e694786
https://github.com/tdewolff/parse/blob/91901180122e1211ba489e7eac0ad991c0da38b2/css/parse.go#L235 https://github.com/tdewolff/parse/blob/91901180122e1211ba489e7eac0ad991c0da38b2/css/parse.go#L381
There are two ToLower calls here, which will modify the case of the original data when parsing
I don't think it should be modified, especially when the data is not css, some strings in the data may be modified after calling parse
You may need to use Copy like here https://github.com/tdewolff/parse/blob/91901180122e1211ba489e7eac0ad991c0da38b2/html/lex.go#L198
or simply delete this call (I am not very proficient in css, and I don't really understand why it needs to be lowercased here)