added files from #862

This commit is contained in:
Tony Tam
2015-01-29 23:12:18 -08:00
parent 0e69c5e1f4
commit 9cb7d8bcbb
3 changed files with 294 additions and 284 deletions

View 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)
)