2018-10-06 23:10:08 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-12-15 14:51:16 +00:00
|
|
|
module Banzai
|
|
|
|
module Pipeline
|
|
|
|
class SingleLinePipeline < GfmPipeline
|
2015-12-30 21:44:22 +00:00
|
|
|
def self.filters
|
2016-03-01 20:54:35 +00:00
|
|
|
@filters ||= FilterArray[
|
2016-10-10 14:46:26 +00:00
|
|
|
Filter::HtmlEntityFilter,
|
2015-12-30 21:44:22 +00:00
|
|
|
Filter::SanitizationFilter,
|
2019-02-20 23:51:55 +00:00
|
|
|
Filter::AssetProxyFilter,
|
2015-12-30 21:44:22 +00:00
|
|
|
Filter::EmojiFilter,
|
|
|
|
Filter::AutolinkFilter,
|
|
|
|
Filter::ExternalLinkFilter,
|
2018-07-13 10:32:49 +00:00
|
|
|
*reference_filters
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.reference_filters
|
|
|
|
[
|
2015-12-30 21:44:22 +00:00
|
|
|
Filter::UserReferenceFilter,
|
|
|
|
Filter::IssueReferenceFilter,
|
|
|
|
Filter::ExternalIssueReferenceFilter,
|
|
|
|
Filter::MergeRequestReferenceFilter,
|
|
|
|
Filter::SnippetReferenceFilter,
|
|
|
|
Filter::CommitRangeReferenceFilter,
|
2020-09-15 03:09:24 +00:00
|
|
|
Filter::CommitReferenceFilter,
|
|
|
|
Filter::AlertReferenceFilter
|
2015-12-30 21:44:22 +00:00
|
|
|
]
|
|
|
|
end
|
2019-01-12 00:31:00 +00:00
|
|
|
|
|
|
|
def self.transform_context(context)
|
2019-02-20 23:51:55 +00:00
|
|
|
context = Filter::AssetProxyFilter.transform_context(context)
|
|
|
|
|
2019-01-12 00:31:00 +00:00
|
|
|
super(context).merge(
|
|
|
|
no_sourcepos: true
|
|
|
|
)
|
|
|
|
end
|
2015-12-15 14:51:16 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2020-04-09 12:09:24 +00:00
|
|
|
|
|
|
|
Banzai::Pipeline::SingleLinePipeline.prepend_if_ee('EE::Banzai::Pipeline::SingleLinePipeline')
|