Module: Scrapouille::Sanitizer

Defined in:
lib/scrapouille/sanitizer.rb

Constant Summary collapse

HTML_NBSP_ENTITY =
"\u00A0".freeze

Class Method Summary collapse

Class Method Details

.clean!(items) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/scrapouille/sanitizer.rb', line 6

def self.clean!(items)
  items.map! do |i|
    next if i.nil?
    n = i.gsub(HTML_NBSP_ENTITY, ' ')
    n = n.squeeze(' ')
    n.strip
  end
end