123456789_123456789_123456789_123456789_123456789_

Module: ActionText::HtmlConversion

Relationships & Source Files
Defined in: actiontext/lib/action_text/html_conversion.rb

Instance Method Summary

Instance Method Details

#create_element(tag_name, attributes = {})

[ GitHub ]

  
# File 'actiontext/lib/action_text/html_conversion.rb', line 17

def create_element(tag_name, attributes = {})
  document.create_element(tag_name, attributes)
end

#document (private)

[ GitHub ]

  
# File 'actiontext/lib/action_text/html_conversion.rb', line 22

def document
  ActionText.html_document_class.new.tap { |doc| doc.encoding = "UTF-8" }
end

#fragment_for_html(html)

[ GitHub ]

  
# File 'actiontext/lib/action_text/html_conversion.rb', line 13

def fragment_for_html(html)
  document.fragment(html)
end

#node_to_html(node)

[ GitHub ]

  
# File 'actiontext/lib/action_text/html_conversion.rb', line 9

def node_to_html(node)
  node.to_html(save_with: Nokogiri::XML::Node::SaveOptions::AS_HTML)
end