Sha256: 2b456550b2490a4b174e908ff69e0357a0f4f45709ba86b19a03854e31ee8059

Contents?: true

Size: 399 Bytes

Versions: 3

Compression:

Stored size: 399 Bytes

Contents

module HtmlToProsemirror
  module Nodes
    class Image < Node

      def matching
        @node.name === 'img'
      end

      def data
        {
          type: "text",
          text: @node.attribute('src').value,
          marks: [{
            type: 'link',
            attrs: {
              href: @node.attribute('src').value
            }
          }]
        }
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
html_to_prosemirror-0.2.0 lib/html_to_prosemirror/nodes/image.rb
html_to_prosemirror-0.1.1 lib/html_to_prosemirror/nodes/image.rb
html_to_prosemirror-0.1.0 lib/html_to_prosemirror/nodes/image.rb