Embedded JavaScript and strings
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 17k
- Forks
- 3.4k
- Avg merge
- 7h 42m
- Merged PRs (30d)
- 26
Description
Strings returned from embedded JavaScript are handled differently when they are inside lists and out of them.
- Escaped js removes quotes from returned strings whether they are inside the list or out of it.
- Embedded js removes quotes from top level strings, but not from strings nested inside a list.
.strings {
string-embedded: `'aaa'` `"bbb"`;
string-escaped: ~`'aaa'` ~`"bbb"`;
strings-list-embedded: `['a', 'b', "c"]`;
strings-list-escaped: ~`['a', 'b', "c"]`;
}
compiles into:
.strings {
string-embedded: "aaa" "bbb";
string-escaped: aaa bbb;
strings-list-embedded: a, b, c;
strings-list-escaped: a, b, c;
}
Is this how it is supposed to be? I am not sure how embedded js should really work. It make sense to strip them, because it is possible to add them from inside js and it would be impossible to return list of idents.
Then again, maybe 'aaa' "bbb" should not keep them there?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the four embedded-JavaScript string examples from the issue in Less.js and compare top-level values with list elements. Read the handling of embedded and escaped JavaScript values, then clarify the intended quote behavior and make the results consistent across both contexts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100