class TextHelper

Public Class Methods

clean_text(text) click to toggle source
# File lib/helpers/text_helper.rb, line 2
def self.clean_text(text)
  clean_text = Sanitize.clean(text)
  clean_text.gsub!("\n", " ")
  clean_text.gsub!("\t", " ")
  clean_text.gsub!(/((http|https|ftp|ftps):\/\/)?([a-zA-Z0-9\-]*\.)+[a-zA-Z0-9]{2,4}(\/[a-zA-Z0-9=.?&-]*)?/i, "")
  return clean_text.strip.gsub("&", "&")
end