added files from #862
This commit is contained in:
5
src/main/coffeescript/helpers/handlebars.coffee
Normal file
5
src/main/coffeescript/helpers/handlebars.coffee
Normal file
@@ -0,0 +1,5 @@
|
||||
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)
|
||||
)
|
||||
Reference in New Issue
Block a user