mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Fix #4686: if a CSX interpolation contains comments, not just inner CSX (JSX) tags, it needs to be wrapped in braces (#4689)
This commit is contained in:
@@ -3403,7 +3403,7 @@ exports.StringWithInterpolations = class StringWithInterpolations extends Base
|
||||
else
|
||||
fragments.push @makeCode '$' unless @csx
|
||||
code = element.compileToFragments(o, LEVEL_PAREN)
|
||||
unless @isNestedTag element
|
||||
if not @isNestedTag(element) or code.some((fragment) -> fragment.comments?)
|
||||
code = @wrapInBraces code
|
||||
# Flag the `{` and `}` fragments as having been generated by this
|
||||
# `StringWithInterpolations` node, so that `compileComments` knows
|
||||
|
||||
Reference in New Issue
Block a user