5 lines
259 B
CoffeeScript
5 lines
259 B
CoffeeScript
Handlebars.registerHelper('sanitize', (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)
|
|
) |