Method: Antwort::PartialBuilder#inline

Defined in:
lib/antwort/builder/partial.rb

#inline(markup) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/antwort/builder/partial.rb', line 35

def inline(markup)
  # Force a complete DOM tree before inlining for nokogiri
  # Otherwise we have random <p> at beginning of document
  html = add_nokogiri_wrapper(markup)

  document = Roadie::Document.new html
  document.add_css(css)
  inlined  = document.transform
  inlined  = cleanup(inlined)

  remove_nokogiri_wrapper(inlined)
end