Class: CodelessCode::Formats::XhtmlDoc

Inherits:
Object
  • Object
show all
Defined in:
lib/codeless_code/formats/base.rb

Overview

MediaCloth expects XHTML-ish pages and chokes on ommited end tags

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(doc) ⇒ XhtmlDoc


45
46
47
# File 'lib/codeless_code/formats/base.rb', line 45

def initialize(doc)
  @doc = doc
end

Class Method Details

.parse(html) ⇒ Object


41
42
43
# File 'lib/codeless_code/formats/base.rb', line 41

def self.parse(html)
  new(Nokogiri::HTML(html))
end

Instance Method Details

#to_sObject


49
50
51
# File 'lib/codeless_code/formats/base.rb', line 49

def to_s
  @doc.css('body > *').to_xhtml
end