I need to get back into using git. The hell is wrong with me!?
This commit is contained in:
9
server/helpers/ProcessText.js
Normal file
9
server/helpers/ProcessText.js
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
let ProcessText = module.exports = {}
|
||||
|
||||
ProcessText.removeHtml = (string) => {
|
||||
return string
|
||||
.replace(/&[#A-Za-z0-9]+;/g,' ') //Rip out all HTML entities
|
||||
.replace(/<[^>]+>/g, ' ') //Rip out all HTML tags
|
||||
.replace(/\s+/g, ' ') //Remove all whitespace
|
||||
}
|
Reference in New Issue
Block a user