Class: UrlFinder::MarkdownReader

Inherits:
BaseReader show all
Defined in:
lib/url_finder/readers/markdown_reader.rb

Overview

Find URLs in Markdown strings

Instance Attribute Summary

Attributes inherited from BaseReader

#content

Instance Method Summary collapse

Methods inherited from BaseReader

#each, #empty?, #initialize, #to_a, urls

Constructor Details

This class inherits a constructor from UrlFinder::BaseReader

Instance Method Details

#urlsArray<String>

Returns the found URLs

Returns:

  • (Array<String>)

    the found URLs



12
13
14
15
16
17
# File 'lib/url_finder/readers/markdown_reader.rb', line 12

def urls
  @urls ||= begin
    html = Kramdown::Document.new(content).to_html
    HTMLReader.new(html).urls
  end
end