ES6 backticks not interpreted correctly
See original GitHub issueFor example, save a file as .js containing:
const a = `b = ${b}`;
const b = `http://${host}/mydir/`;
'string';
// comment
In the case of a
, the b =
is black as if it were code. Only the ${b}
is code, and b =
is like a string.
With b
, the //
is interpreted as a comment (which it isn’t) and the rest of the line is green.
Compare github’s rendering of the above with FlashDevelop’s.
This is on 5.1.0.3, win7x64sp1 (no updates available when I checked just now.)
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
javascript - Template literals like 'some ${string}' or " ...
JavaScript template literals require backticks, not straight quotation marks. You need to use backticks (otherwise known as "grave accents" ...
Read more >Why isn't string interpolation working? (Check for backticks)
Hi, i have some practical experience coding, I am not completely new to this. That said, I have noticed the check that determines...
Read more >ES6 ECMA6 template literals not working in JavaScript
Template literals are surrounded by the backtick (' ') character as opposed to quotes in strings. Placeholders, denoted by the dollar sign and ......
Read more >backticks not treated as string delimiters (CVE-2023-24538 ...
Templates did not properly consider backticks (`) as Javascript string delimiters, and as such did not escape them as expected.
Read more >ES6 In Depth: Template strings
But there's a reason these are called “template strings” and not “boring plain old strings that don't do anything special, only with backticks”....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
String interpolation works now too in the internal Scintilla build used here. This implementation is generic and would be able to support multiple interpolation syntaxes, so hopefully it will be approved by the Scintilla people. Still a couple of things missing in Haxe, but for most use cases it should be fine:
That’s right, this change will hopefully add string interpolation support in a way Scintilla developers will be able to add it also to other languages.
I cannot give an exact date, but I don’t think it should take too much longer. Most issues found so far have been fixed.