Shopify / javascript

The home for all things JavaScript at Shopify.
MIT License
253 stars 38 forks source link

CoffeeScript compilation of `"""` causes incorrect escaping #53

Closed lemonmade closed 8 years ago

lemonmade commented 8 years ago

This is probably an issue with our decaf fork, but putting it here for posterity. The following CoffeeScript:

FIXTURE = """
  <div id="outer" style="height: #{CONTAINER_HEIGHT}px; overflow: scroll">
    <div id="inner" style="height: #{CONTENT_HEIGHT}px"></div>
  </div>
"""

Gets compiled to this through esify:

const FIXTURE = (`<div id=\\"outer\\" style=\\"height: ${CONTAINER_HEIGHT}px; overflow: scroll\\">\\n  <div id=\\"inner\\" style=\\"height: ${CONTENT_HEIGHT}px\\"></div>\\n</div>`);
lemonmade commented 8 years ago

I'm going to close this, I left a note on esify about the trouble with multiline/ complex strings, and we corrected some of the tricky parts in shopify/shopify.