Module: Nokogiri::XML

Defined in:
lib/nokogiri/sugar.rb

Class Method Summary collapse

Class Method Details

.remove_markup_outline(str) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/nokogiri/sugar.rb', line 26

def self.remove_markup_outline(str)
  f = Nokogiri::XML.fragment(str)
  ['b', 'strong', 'strike', 'i', 'u'].each do |s|
    f.search('.//' + s).remove
  end
  f.to_outline
end