Class: Banzai::Filter::UploadLinkFilter

Inherits:
BaseRelativeLinkFilter show all
Defined in:
lib/banzai/filter/upload_link_filter.rb

Overview

HTML filter that “fixes” links to uploads.

Context options:

:group
:only_path
:project
:system_note

Constant Summary

Constants inherited from BaseRelativeLinkFilter

BaseRelativeLinkFilter::CSS, BaseRelativeLinkFilter::XPATH

Instance Method Summary collapse

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Instance Method Details

#callObject


15
16
17
18
19
20
21
22
23
24
25
# File 'lib/banzai/filter/upload_link_filter.rb', line 15

def call
  return doc if context[:system_note]

  # We exclude processed upload links from the linkable attributes to
  # prevent further modifications by RepositoryLinkFilter
  linkable_attributes.reject! do |attr|
    process_link_to_upload_attr(attr)
  end

  doc
end