Skip to content

Instantly share code, notes, and snippets.

@dancek
Created August 11, 2014 13:26
Show Gist options
  • Save dancek/a6b3b9c1660a20174ffd to your computer and use it in GitHub Desktop.
Save dancek/a6b3b9c1660a20174ffd to your computer and use it in GitHub Desktop.
How different multiline strings behave in CoffeeScript 1.7
a = """<p>
foo
</p>"""
b = '''<p>
foo
</p>'''
c = "<p>
foo
</p>"
d = '<p>
foo
</p>'
e = "<p>\
foo\
</p>"
f = '<p>\
foo\
</p>'
var a, b, c, d, e, f;
a = "<p>\n foo\n</p>";
b = '<p>\n foo\n</p>';
c = "<p> foo </p>";
d = '<p> foo </p>';
e = "<p>foo</p>";
f = '<p>foo</p>';
@dancek
Copy link
Author

dancek commented Aug 11, 2014

Note: CoffeeScript < 1.7 actually behaves differently (there's no way to get rid of whitespace in indentation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment