1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-20 10:50:08 +03:00

Feature #3748: New handlebar helper htmlDecode

This commit is contained in:
Carlos Martín 2015-06-16 17:09:11 +02:00
parent f93cce6903
commit 64ac4a3930

View File

@ -0,0 +1,18 @@
define(function(require) {
/**
* Decodes an escaped html string back to html. For example,
* "<p>This is a test</p>" -->
* "<p>This is a test</p>"
*/
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;
});