Sha256: 103d953873542a4de7beee7fc40982135ff7011418c5268f35912acb6407ef73

Contents?: true

Size: 394 Bytes

Versions: 8

Compression:

Stored size: 394 Bytes

Contents

module ReverseMarkdown
  module Converters
    class A < Base
      def convert(node)
        name  = treat_children(node)
        href  = node['href']
        title = extract_title(node)

        if href.to_s.start_with?('#') || href.to_s.empty? || name.empty?
          name
        else
          " [#{name}](#{href}#{title})"
        end
      end
    end

    register :a, A.new
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
reverse_markdown-0.8.2 lib/reverse_markdown/converters/a.rb
reverse_markdown-0.8.1 lib/reverse_markdown/converters/a.rb
reverse_markdown-0.8.0 lib/reverse_markdown/converters/a.rb
reverse_markdown-0.7.0 lib/reverse_markdown/converters/a.rb
reverse_markdown-0.6.1 lib/reverse_markdown/converters/a.rb
reverse_markdown-0.6.0 lib/reverse_markdown/converters/a.rb
reverse_markdown-0.5.1 lib/reverse_markdown/converters/a.rb
reverse_markdown-0.5.0 lib/reverse_markdown/converters/a.rb