Class: Orph
- Inherits:
-
Object
- Object
- Orph
- Defined in:
- lib/orph.rb,
lib/orph/version.rb
Constant Summary collapse
- VERSION =
"0.1.1"
Instance Attribute Summary collapse
-
#content_tags ⇒ Object
Returns the value of attribute content_tags.
Instance Method Summary collapse
- #fix(html) ⇒ Object
-
#initialize ⇒ Orph
constructor
A new instance of Orph.
Constructor Details
#initialize ⇒ Orph
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_tags ⇒ Object
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 |