class JekyllAbsoluteLinks::Crawler

Private Class Methods

transform(output, regexp, site_url) click to toggle source
# File lib/jekyll-absolute-links/crawler.rb, line 22
def transform(output, regexp, site_url)
  output.gsub!(regexp) do |match|
    url = $~[:url]
    new_url =
      if url != nil
        "#{site_url}#{url}".gsub(%r{(\w)/+}, "\\1/")
      else
        $~[0]
      end
    new_url
  end
end