Sha256: d226ad506121bbae5088472c00d2aa6331e65a6921c206f61f4fca7169be7f77

Contents?: true

Size: 533 Bytes

Versions: 21

Compression:

Stored size: 533 Bytes

Contents

# frozen_string_literal: true

# :markup: markdown

module ActionText
  module HtmlConversion
    extend self

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

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

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

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

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
actiontext-8.0.1 lib/action_text/html_conversion.rb
actiontext-8.0.0.1 lib/action_text/html_conversion.rb
actiontext-7.2.2.1 lib/action_text/html_conversion.rb
actiontext-8.0.0 lib/action_text/html_conversion.rb
actiontext-7.2.2 lib/action_text/html_conversion.rb
actiontext-8.0.0.rc2 lib/action_text/html_conversion.rb
actiontext-7.2.1.2 lib/action_text/html_conversion.rb
actiontext-8.0.0.rc1 lib/action_text/html_conversion.rb
actiontext-7.2.1.1 lib/action_text/html_conversion.rb
actiontext-8.0.0.beta1 lib/action_text/html_conversion.rb
omg-actiontext-8.0.0.alpha9 lib/action_text/html_conversion.rb
omg-actiontext-8.0.0.alpha8 lib/action_text/html_conversion.rb
omg-actiontext-8.0.0.alpha7 lib/action_text/html_conversion.rb
omg-actiontext-8.0.0.alpha4 lib/action_text/html_conversion.rb
omg-actiontext-8.0.0.alpha3 lib/action_text/html_conversion.rb
actiontext-7.2.1 lib/action_text/html_conversion.rb
actiontext-7.2.0 lib/action_text/html_conversion.rb
actiontext-7.2.0.rc1 lib/action_text/html_conversion.rb
actiontext-7.2.0.beta3 lib/action_text/html_conversion.rb
actiontext-7.2.0.beta2 lib/action_text/html_conversion.rb