2018-10-06 19:10:08 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-12-15 09:51:16 -05:00
|
|
|
module Banzai
|
|
|
|
module Pipeline
|
|
|
|
class PostProcessPipeline < BasePipeline
|
|
|
|
def self.filters
|
2018-07-13 06:32:49 -04:00
|
|
|
@filters ||= FilterArray[
|
|
|
|
*internal_link_filters,
|
2020-03-17 20:09:16 -04:00
|
|
|
Filter::AbsoluteLinkFilter,
|
|
|
|
Filter::BroadcastMessagePlaceholdersFilter
|
2018-07-13 06:32:49 -04:00
|
|
|
]
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.internal_link_filters
|
|
|
|
[
|
2019-07-16 16:19:08 -04:00
|
|
|
Filter::ReferenceRedactorFilter,
|
2019-07-10 07:27:25 -04:00
|
|
|
Filter::InlineMetricsRedactorFilter,
|
2020-01-14 16:07:45 -05:00
|
|
|
# UploadLinkFilter must come before RepositoryLinkFilter to
|
|
|
|
# prevent unnecessary Gitaly calls from being made.
|
|
|
|
Filter::UploadLinkFilter,
|
|
|
|
Filter::RepositoryLinkFilter,
|
2018-12-13 14:17:19 -05:00
|
|
|
Filter::IssuableStateFilter,
|
|
|
|
Filter::SuggestionFilter
|
2015-12-15 09:51:16 -05:00
|
|
|
]
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.transform_context(context)
|
|
|
|
context.merge(
|
|
|
|
post_process: true
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2020-04-09 08:09:24 -04:00
|
|
|
|
|
|
|
Banzai::Pipeline::PostProcessPipeline.prepend_if_ee('EE::Banzai::Pipeline::PostProcessPipeline')
|