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
SCSS Interpolation in strings #37
Comments
I'd go with |
Sounds good! Just a quick note: As far as I know, Less only supports simple variable interpolations of the form |
@lydell are you interested in submitting a PR for this? |
No, I'm not. I wish I was, though. |
Happy to report that the offending css value passes in the const options = {
interpolation: { prefix: '#' }
};
const root = parse('a #{"1"} b #{2} c', options); I'll be releasing a beta of 3.0.0 later today. Thanks for reporting the issue. Cheers 🍻 |
This issue is regarding a problem with:
Actual Behavior
Parsed as:
Expected Behavior
Proposal:
Similar to how Babylon parses template literals in JavaScript: astexplorer
Something like this:
(The "expressions" and "quasis" names comes from Babylon’s AST. I made up "InterpolationStringNode". I don’t care about what they’re called.)
When you encounter
#{
in a stringquasis
}
. (Error handling, if no ending}
is found throwTokenizeError: Unclosed interpolation
or something.)#{
).Notes:
interpolations (recursively).
"\#{1}"
is a singleStringNode
.How can we reproduce the behavior?
Related
The text was updated successfully, but these errors were encountered: