shunter
Version:
A Node.js application built to read JSON and translate it into HTML
18 lines (15 loc) • 313 B
JavaScript
;
module.exports = initFilter;
function initFilter(dust) {
dust.filters.html = function (value) {
var escapes = {
'<': '<',
'>': '>',
'"': '"',
'\'': '''
};
return dust.filters.amp(value).replace(/[<>"']/g, function (match) {
return escapes[match];
});
};
}