- function filterXSS(str) {
- return str
- .replace(/&/g, '&')
- .replace(/ /g, ' ')
- .replace(/, '<')
- .replace(/>/g, '>')
- .replace(/"/g, '"')
- .replace(/'/g, "'")
- .replace(/\r{0,}\n/g, '
') - }