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:
Geoffrey Booth
2017-08-27 15:16:31 -07:00
committed by GitHub
parent 5713b7eb6c
commit 9ff82fe17b
2 changed files with 2 additions and 2 deletions

View File

@@ -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) ->