You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: upload_link_filter.rb
    path of file: ./repos/gitlabhq/lib/banzai/filter
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require 'uri'

module Banzai
  module Filter
    # HTML filter that "fixes" links to uploads.
    #
    #
    
      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

      protected

      def process_link_to_upload_attr(html_attr)
        return unless html_attr.value.start_with?('/uploads/')

        path_parts = [unescape_and_scrub_uri(html_attr.value)]

        if project
          path_parts.unshift(relative_url_root, project.full_path)
        elsif group
          path_parts.unshift(relative_url_root, 'groups', group.full_path, '-')
        else
          path_parts.unshift(relative_url_root)
        end

        begin
          path = Addressable::URI.escape(File.join(*path_parts))
        rescue Addressable::URI::InvalidURIError
          return
        end