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 SingleLinePipeline < GfmPipeline
|
2019-09-13 09:26:31 -04:00
|
|
|
prepend_if_ee('EE::Banzai::Pipeline::SingleLinePipeline') # rubocop: disable Cop/InjectEnterpriseEditionModule
|
|
|
|
|
2015-12-30 16:44:22 -05:00
|
|
|
def self.filters
|
2016-03-01 15:54:35 -05:00
|
|
|
@filters ||= FilterArray[
|
2016-10-10 10:46:26 -04:00
|
|
|
Filter::HtmlEntityFilter,
|
2015-12-30 16:44:22 -05:00
|
|
|
Filter::SanitizationFilter,
|
2019-02-20 18:51:55 -05:00
|
|
|
Filter::AssetProxyFilter,
|
2015-12-15 09:51:16 -05:00
|
|
|
|
2015-12-30 16:44:22 -05:00
|
|
|
Filter::EmojiFilter,
|
|
|
|
Filter::AutolinkFilter,
|
|
|
|
Filter::ExternalLinkFilter,
|
|
|
|
|
2018-07-13 06:32:49 -04:00
|
|
|
*reference_filters
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.reference_filters
|
|
|
|
[
|
2015-12-30 16:44:22 -05:00
|
|
|
Filter::UserReferenceFilter,
|
|
|
|
Filter::IssueReferenceFilter,
|
|
|
|
Filter::ExternalIssueReferenceFilter,
|
|
|
|
Filter::MergeRequestReferenceFilter,
|
|
|
|
Filter::SnippetReferenceFilter,
|
|
|
|
Filter::CommitRangeReferenceFilter,
|
2018-07-13 06:32:49 -04:00
|
|
|
Filter::CommitReferenceFilter
|
2015-12-30 16:44:22 -05:00
|
|
|
]
|
|
|
|
end
|
2019-01-11 19:31:00 -05:00
|
|
|
|
|
|
|
def self.transform_context(context)
|
2019-02-20 18:51:55 -05:00
|
|
|
context = Filter::AssetProxyFilter.transform_context(context)
|
|
|
|
|
2019-01-11 19:31:00 -05:00
|
|
|
super(context).merge(
|
|
|
|
no_sourcepos: true
|
|
|
|
)
|
|
|
|
end
|
2015-12-15 09:51:16 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|