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
|
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-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
|
|
|
|
[
|
2021-04-15 14:09:01 -04:00
|
|
|
Filter::References::UserReferenceFilter,
|
|
|
|
Filter::References::IssueReferenceFilter,
|
|
|
|
Filter::References::ExternalIssueReferenceFilter,
|
|
|
|
Filter::References::MergeRequestReferenceFilter,
|
|
|
|
Filter::References::SnippetReferenceFilter,
|
|
|
|
Filter::References::CommitRangeReferenceFilter,
|
|
|
|
Filter::References::CommitReferenceFilter,
|
|
|
|
Filter::References::AlertReferenceFilter,
|
|
|
|
Filter::References::FeatureFlagReferenceFilter
|
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
|
2020-04-09 08:09:24 -04:00
|
|
|
|
2021-05-11 17:10:21 -04:00
|
|
|
Banzai::Pipeline::SingleLinePipeline.prepend_mod_with('Banzai::Pipeline::SingleLinePipeline')
|