Class: UnTable

Inherits:
Object show all
Defined in:
lib/el4r/el4r-sub.rb

Overview

UnTable Strip table-related tags in HTML

Instance Method Summary collapse

Instance Method Details

#untable(src) ⇒ Object



868
869
870
# File 'lib/el4r/el4r-sub.rb', line 868

def untable(src)
  untable!(src.dup)
end

#untable!(src) ⇒ Object

Strip table-related tags in SRC



859
860
861
862
863
864
865
866
# File 'lib/el4r/el4r-sub.rb', line 859

def untable!(src)
  src.gsub!(%r!</?(table)\b[^>]*>!i,'')
#    src.gsub!(%r!<t[hd]\b[^>]*>!i,'&nbsp;')
  src.gsub!(%r!<t[hd]\b[^>]*>!i,'')
  src.gsub!(%r!<tr[^>]*>!i,'<br>')
  src.gsub!(%r!</tr>!i, '')
  src
end