Convert helpers/handlebars.coffee
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
"HeaderView": false,
|
||||
"MainView": false,
|
||||
"Docs": false,
|
||||
"SwaggerClient": false
|
||||
"SwaggerClient": false,
|
||||
"Handlebars": false
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
)
|
||||
7
src/main/coffeescript/helpers/handlebars.js
Normal file
7
src/main/coffeescript/helpers/handlebars.js
Normal 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);
|
||||
});
|
||||
Reference in New Issue
Block a user