Multiple string interpolation
For long strings in CoffeeScript consider using the heredocs notation:

logs[index].extra = {
  message: """
           Camera came online
           &lt;span class='message'&gt;
             after #{getTime2(online, offline)}
           &lt;/span&gt;
           """
}


or simply concatenate multiple lines:

logs[index].extra = {
  message: "Camera came online" +
           "&lt;span class='message'&gt;" +
           "  after #{getTime2(online, offline)}" +
           "&lt;/span&gt;"
}


The extra newlines and multiple spaces shouldn't matter in HTML since they're all trimmed to one space by the renderer (except defined otherwise, e.g. in pre or code).



It wasn't your question, but please also consider this syntax for defining an object and adding a field to it. I think it's better readable due to less indentation, it's more explicit and doesn't make anyone thing you'd add on top of an existing object:

logs[index].extra = {}
logs[index].extra.message = "Camera came online" +
                            "&lt;span class='message'&gt;" +
                            "  after #{getTime2(online, offline)}" +
                            "&lt;/span&gt;"


The code from this example is equivalent to the code above it.