Skip to content

Instantly share code, notes, and snippets.

@svasva
Created February 23, 2013 12:18
Show Gist options
  • Save svasva/5019570 to your computer and use it in GitHub Desktop.
Save svasva/5019570 to your computer and use it in GitHub Desktop.
Handlebars.registerHelper 'multiline', (string) ->
result = ''
for line in string.split("\n")
result += _.escape(line) + '<br/>'
return new Handlebars.SafeString(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment