gitlab-org--gitlab-foss/lib/banzai/pipeline/post_process_pipeline.rb

37 lines
1 KiB
Ruby

# frozen_string_literal: true
module Banzai
module Pipeline
class PostProcessPipeline < BasePipeline
def self.filters
@filters ||= FilterArray[
Filter::TruncateVisibleFilter,
*internal_link_filters,
Filter::AbsoluteLinkFilter,
Filter::BroadcastMessagePlaceholdersFilter
]
end
def self.internal_link_filters
[
Filter::ReferenceRedactorFilter,
Filter::InlineMetricsRedactorFilter,
# UploadLinkFilter must come before RepositoryLinkFilter to
# prevent unnecessary Gitaly calls from being made.
Filter::UploadLinkFilter,
Filter::RepositoryLinkFilter,
Filter::IssuableReferenceExpansionFilter,
Filter::SuggestionFilter
]
end
def self.transform_context(context)
context.merge(
post_process: true
)
end
end
end
end
Banzai::Pipeline::PostProcessPipeline.prepend_mod_with('Banzai::Pipeline::PostProcessPipeline')