Multiline template strings that don't break indentation

Owen Densmore owen at
Wed Sep 17 19:44:14 PDT 2014

I'm always surprised we keep forgetting coffeescrip,

     Multiline strings are allowed in CoffeeScript.
     Lines are joined by a single space unless they end with a backslash.
     Indentation is ignored.

mobyDick = "Call me Ishmael. Some years ago -- never mind how long
precisely -- having little or no money in my purse, and nothing particular
to interest me on shore, I thought I would sail about a little and see the
watery part of the world..."


     Block strings can be used to hold formatted or indentation-sensitive
     (or, if you just don't feel like escaping quotes and apostrophes).
     The indentation level that begins the block is maintained throughout,
     so you can keep it all aligned with the body of your code.

html = """ <strong> cup of coffeescript </strong> """

 -- Owen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list