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
  self.content =~ /\S/ ? self.content.gsub(/\s+/,' ').strip : self.content
end

#normalize!Object


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

def normalize!
  self.content = self.normalize
end