Sha256: 36380aae41d0cd238aec8943c00740f3b64b35a0ca24112749e4e5f6c6bcbde7

Contents?: true

Size: 512 Bytes

Versions: 16

Compression:

Stored size: 512 Bytes

Contents

# frozen_string_literal: true

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

16 entries across 16 versions & 3 rubygems

Version Path
actiontext-7.1.5 lib/action_text/html_conversion.rb
actiontext-7.1.4.2 lib/action_text/html_conversion.rb
actiontext-7.1.4.1 lib/action_text/html_conversion.rb
actiontext-7.1.4 lib/action_text/html_conversion.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/actiontext-7.1.3.4/lib/action_text/html_conversion.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/actiontext-7.1.3.4/lib/action_text/html_conversion.rb
actiontext-7.1.3.4 lib/action_text/html_conversion.rb
actiontext-7.1.3.2 lib/action_text/html_conversion.rb
actiontext-7.1.3.1 lib/action_text/html_conversion.rb
actiontext-7.1.3 lib/action_text/html_conversion.rb
actiontext-7.1.2 lib/action_text/html_conversion.rb
actiontext-7.1.1 lib/action_text/html_conversion.rb
actiontext-7.1.0 lib/action_text/html_conversion.rb
actiontext-7.1.0.rc2 lib/action_text/html_conversion.rb
actiontext-7.1.0.rc1 lib/action_text/html_conversion.rb
actiontext-7.1.0.beta1 lib/action_text/html_conversion.rb