Created
July 26, 2013 16:17
-
-
Save lagartoflojo/6090175 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ember.Handlebars.helper 'format', (body) -> | |
body = Handlebars.Utils.escapeExpression(body) | |
body = body.replace(/\n\r?/g, '<br>') | |
new Handlebars.SafeString(body) | |
# Usage: {{format stringWithNewLines}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
May want to update your gist
see http://guides.emberjs.com/v1.10.0/templates/writing-helpers/
With the new Ember using HTMLBars it needs to change. :]