SolidScribe/server/helpers/ProcessText.js

9 lines
258 B
JavaScript
Raw Normal View History

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
}