Class: Banzai::Filter::WikiLinkFilter

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

Overview

HTML filter that “fixes” relative links to files in a repository.

Context options:

:project_wiki

Instance Method Summary collapse

Instance Method Details

#callObject


11
12
13
14
15
16
17
18
19
# File 'lib/banzai/filter/wiki_link_filter.rb', line 11

def call
  return doc unless project_wiki?

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

  doc
end