Sha256: 5380dff21fca65c6dea83a4c6a5afca3fd08f0f785bf1df90fded8631a1bdf09

Contents?: true

Size: 512 Bytes

Versions: 1

Compression:

Stored size: 512 Bytes

Contents

module ProsemirrorToHtml
  module Marks
    class Link < Mark
      @mark_type = 'link'
      @tag_name = 'a'

      def tag
        attrs = {}

        attrs['href'] = @mark.attrs.href

        attrs['target'] = @mark.attrs.target if @mark.attrs.target
        attrs['title'] = @mark.attrs.title if @mark.attrs.title
        attrs['rel'] = @mark.attrs.rel if @mark.attrs.rel

        [
          {
            tag: self.class.tag_name,
            attrs: attrs
          }
        ]
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
prosemirror_to_html-0.2.0 lib/prosemirror_to_html/marks/link.rb