Class: Orph

Inherits:
Object
  • Object
show all
Defined in:
lib/orph.rb,
lib/orph/version.rb

Constant Summary collapse

VERSION =
"0.1.1"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOrph

Returns a new instance of Orph.



7
8
9
# File 'lib/orph.rb', line 7

def initialize
  self. = %w(h1 h2 h3 h4 h5 h6 p li blockquote dt dd)
end

Instance Attribute Details

#content_tagsObject

Returns the value of attribute content_tags.



5
6
7
# File 'lib/orph.rb', line 5

def 
  @content_tags
end

Instance Method Details

#fix(html) ⇒ Object



11
12
13
14
15
# File 'lib/orph.rb', line 11

def fix(html)
  doc = Nokogiri::HTML::DocumentFragment.parse(html, "ASCII")
  parse_nodes(doc.children)
  doc.to_html
end