Class: Nokogiri::XML::Text

Inherits:
Object
  • Object
show all
Defined in:
lib/dor/utils/ng_tidy.rb

Instance Method Summary collapse

Instance Method Details

#normalizeObject



4
5
6
# File 'lib/dor/utils/ng_tidy.rb', line 4

def normalize
  content =~ /\S/ ? content.gsub(/\s+/, ' ').strip : content
end

#normalize!Object



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

def normalize!
  self.content = normalize
end