Skip to content
Permalink
0cef07a8ca
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
14 lines (13 sloc) 326 Bytes
const SCRIPT_REGEX = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;
/**
* Default Html Sanitizer to prevent script injection.
*/
export class HTMLSanitizer {
/**
* Sanitizes the provided input.
* @param input The input to be sanitized.
*/
sanitize(input) {
return input.replace(SCRIPT_REGEX, '');
}
}