Sha256: e130c0c0ec4f7224cf2b814754fc75c43c7d253ee1783b596ec58af254614551

Contents?: true

Size: 446 Bytes

Versions: 3

Compression:

Stored size: 446 Bytes

Contents

# frozen_string_literal: true

require 'kramdown'
require 'url_finder/readers/base_reader'
require 'url_finder/readers/html_reader'

module UrlFinder
  # Find URLs in Markdown strings
  class MarkdownReader < BaseReader
    # Returns the found URLs
    # @return [Array<String>] the found URLs
    def urls
      @urls ||= begin
        html = Kramdown::Document.new(content).to_html
        HTMLReader.new(html).urls
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
url_finder-0.2.2 lib/url_finder/readers/markdown_reader.rb
url_finder-0.2.1 lib/url_finder/readers/markdown_reader.rb
url_finder-0.2.0 lib/url_finder/readers/markdown_reader.rb