-
Notifications
You must be signed in to change notification settings - Fork 465
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
Fix interpolation edge cases with escapes #1118
Conversation
👍 |
I've created the spec for this issue - sass/sass-spec#340 This PR is an improvement on the current behaviour, however it still fails this spec. |
So I've spent all weekend getting my head around our string handling code, and feel it's already over complicated. I'm super reluctant to add another flag to our String AST nodes i.e. I wonder if we can tackle this case entirely in the Eval phase instead? |
8e04865
to
08a00b5
Compare
@xzyfer I fully agree, but the handling by ruby sass is pretty complex and AFAIR I was able to get rid of quite a few flags with my last refactoring. But I pretty much gave up to understand how ruby sass internally handles interpolations and escape sequences (We keep finding new edge cases all the time). So for the time beeing I really only see the way to implement specific code paths for these cases, until we have a good enough spec suite to tackle another refactoring. My last commit should solve the reported issues, but it is far away from beeing pretty. I'm having problems coming up with ideas how to name all those different escape/unescape functions, but I currently don't see a way to get rid of them. |
08a00b5
to
e771bc5
Compare
Btw. I have used this extended test case: foo {
content: "x\79";
content: "#{x}\79";
content: "x\0\1\2\3\4\5\6\7\8\9\7a";
content: "#{x}\0\1\2\3\4\5\6\7\8\9\7a";
content: "x#{\0\1\2\3\4\5\6\7\8\9}\7a";
content: "x\a\A\b\B\c\C\d\D\e\E\f\F\g\G\7a";
content: "#{x}\a\A\b\B\c\C\d\D\e\E\f\F\g\G\7a";
content: "x#{\a\A\b\B\c\C\d\D\e\E\f\F\g\G}\7a";
}
baz {
// another regression
content: "xy#{\7a}";
} |
737e571
to
d928f7d
Compare
d928f7d
to
8265b6b
Compare
Fix interpolation edge cases with escapes
Fixes #1115