diff --git a/src/sunstone/public/app/templates/helpers/htmlDecode.js b/src/sunstone/public/app/templates/helpers/htmlDecode.js new file mode 100644 index 0000000000..b69a2f1836 --- /dev/null +++ b/src/sunstone/public/app/templates/helpers/htmlDecode.js @@ -0,0 +1,18 @@ +define(function(require) { + /** + * Decodes an escaped html string back to html. For example, + * "<p>This is a test</p>" --> + * "
This is a test
" + */ + + var Handlebars = require('hbs/handlebars'); + var TemplateUtils = require('utils/template-utils'); + + var htmlDecode = function(value, options) { + return TemplateUtils.htmlDecode(value); + }; + + Handlebars.registerHelper('htmlDecode', htmlDecode); + + return htmlDecode; +}); \ No newline at end of file