Class: Banzai::Filter::AbsoluteLinkFilter

Inherits:
HTML::Pipeline::Filter
  • Object
show all
Defined in:
lib/banzai/filter/absolute_link_filter.rb

Overview

HTML filter that converts relative urls into absolute ones.

Instance Method Summary collapse

Instance Method Details

#callObject


9
10
11
12
13
14
15
16
17
# File 'lib/banzai/filter/absolute_link_filter.rb', line 9

def call
  return doc unless context[:only_path] == false

  doc.search('a.gfm').each do |el|
    process_link_attr el.attribute('href')
  end

  doc
end