Last active
August 29, 2015 14:03
-
-
Save dustinfarris/717337b4261a76985588 to your computer and use it in GitHub Desktop.
Basic SafeString Handlebars helper
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
// app/helpers/safe-string.js | |
import Ember from 'ember'; | |
/** | |
* Do not escape special characters. | |
* | |
* Usage: | |
* | |
* ```hbs | |
* {{safe-string "<span>My raw HTML code</span>"}} | |
* ``` | |
* | |
* @class SafeStringHelper | |
*/ | |
export default Ember.Handlebars.makeBoundHelper(function(value) { | |
return new Ember.Handlebars.SafeString(value); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment