7 lines
286 B
JavaScript
7 lines
286 B
JavaScript
'use strict';
|
|
|
|
Handlebars.registerHelper('sanitize', function(html) {
|
|
// Strip the script tags from the html, and return it as a Handlebars.SafeString
|
|
html = html.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
|
|
return new Handlebars.SafeString(html);
|
|
}); |