stripTags and escape template helpers

use it like so {function.stripTags, title}
see vanilla or persona topics_list.tpl for more info
v1.18.x
psychobunny 10 years ago
parent 41db2dcd14
commit 789418f987

@ -1,6 +1,6 @@
;(function(exports) {
"use strict";
/* globals define */
/* globals define, utils */
// export the class if we are in a Node-like system.
if (typeof module === 'object' && module.exports === exports) {
@ -9,6 +9,9 @@
var helpers = {};
var utils = utils || require('../utils'),
S = S || require('string');
helpers.displayMenuItem = function(data, index) {
var item = data.navigation[index],
properties = item.properties;
@ -43,6 +46,14 @@
return JSON.stringify(obj).replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;").replace(/"/g, '&quot;');
};
helpers.escape = function(str) {
return utils.escapeHTML(str);
};
helpers.stripTags = function(str) {
return S(str).stripTags().s;
}
helpers.generateCategoryBackground = function(category) {
var style = [];

Loading…
Cancel
Save