mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Fix #4589: Unquote all interpolated strings, not just CSX ones, so that quotation marks are not unnecessarily escaped in backtick-delimited strings/template literals (#4660)
This commit is contained in:
@@ -3391,7 +3391,7 @@ exports.StringWithInterpolations = class StringWithInterpolations extends Base
|
||||
fragments.push @makeCode '`' unless @csx
|
||||
for element in elements
|
||||
if element instanceof StringLiteral
|
||||
element.value = element.unquote @csx
|
||||
element.value = element.unquote yes
|
||||
unless @csx
|
||||
# Backticks and `${` inside template literals must be escaped.
|
||||
element.value = element.value.replace /(\\*)(`|\$\{)/g, (match, backslashes, toBeEscaped) ->
|
||||
|
||||
Reference in New Issue
Block a user