Convert helpers/handlebars.coffee

This commit is contained in:
Mohsen Azimi
2015-03-12 10:10:16 -07:00
parent 846d589a7e
commit 15d1e22dbf
3 changed files with 9 additions and 6 deletions

View File

@@ -25,6 +25,7 @@
"HeaderView": false,
"MainView": false,
"Docs": false,
"SwaggerClient": false
"SwaggerClient": false,
"Handlebars": false
}
}

View File

@@ -1,5 +0,0 @@
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)
)

View File

@@ -0,0 +1,7 @@
'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);
});