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
Breaking change un 1.3 on selector re-parsing (again :/) #273
Comments
(Additionaly, the call of |
maybe we should revert the selector re-parsing until we have a spec compliant selector handling |
Maybe, that's something to consider. So you could experience the bug or not depending what kind of selector you are producing. |
@Cerdic but your PR added also a new exception which was not there before when re-parsing: 8a30458#diff-47bc8653b21716576958e25b6d7356ecb0f0070f17554d12d2bee985ac211b26R285 |
You are totaly right! I forgot that point. Looking a bit in detail, it seems here the bug is not really the re-parsing but the escaping of $ char in selectors: The compilation of
Produce with scssphp
which is not css valid, and if you are re-parsing this you are getting a parser error. We should have an escaped char in the result
So the fact is with previous version of scssphp these erroneous selectors produces by scssphp were probably ignored by browsers. That said, and unlinked to fixing this |
Well, if you manage to fix the escaping issue in a reasonable time, that would still be a better solution, as we would be fixing a bug. But I fear that it may take time. |
…unescaped in the output, leading to unvalid selectors that the parser itself is refusing as valid. For now we are keeping the escaped sequence in the selector, in a normalize way, to not take the risk to produce an unvalid selector The target and safer should be to have the same way of managing escpaing as in string and keyword: store the real char in a non escaped form in the selector representation, and escape in the output what should be escaped only. But this require a better structure for representation of selectors out of the parser, otherwise this would more or less implie to reparse in the compiler to know what to escape, which would be a shame (ie for instance escape non alpha first chars of identifiers and non allowed chars in identifier, but without escaping attributes content matching)
I think I have an acceptable fix with #274 |
Related to #245 and compiled selector re-parsing to check they are valid
produce
Whereas Sassmeister produce
The real bug is probably in the selector Parsing here, due to escaped chars in the selectors
The text was updated successfully, but these errors were encountered: