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



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

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

#normalize!Object



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

def normalize!
  self.content = normalize
end