Module: Sanitizer

Defined in:
lib/utils/sanitizer.rb

Class Method Summary collapse

Class Method Details

.remove_bullet_points(text) ⇒ Object

Remove bullet point characters



13
14
15
# File 'lib/utils/sanitizer.rb', line 13

def self.remove_bullet_points(text)
  text.gsub("", "")
end

.remove_excessive_newlines(text) ⇒ Object

Remove sequences of more than two newline characters



3
4
5
# File 'lib/utils/sanitizer.rb', line 3

def self.remove_excessive_newlines(text)
  text.gsub(/(\n\s*){3,}/, "\n\n")
end

.remove_excessive_spaces(text) ⇒ Object

Remove sequences of more than two spaces and replace with one space



8
9
10
# File 'lib/utils/sanitizer.rb', line 8

def self.remove_excessive_spaces(text)
  text.gsub(/ {3,}/, ' ')
end