2018-12-13 13:39:08 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-12-23 02:04:40 +05:30
|
|
|
module Banzai
|
|
|
|
module Pipeline
|
|
|
|
class SingleLinePipeline < GfmPipeline
|
2016-01-14 18:37:52 +05:30
|
|
|
def self.filters
|
2016-06-02 11:05:42 +05:30
|
|
|
@filters ||= FilterArray[
|
2016-11-03 12:29:30 +05:30
|
|
|
Filter::HtmlEntityFilter,
|
2016-01-14 18:37:52 +05:30
|
|
|
Filter::SanitizationFilter,
|
2019-09-04 21:01:54 +05:30
|
|
|
Filter::AssetProxyFilter,
|
2016-01-14 18:37:52 +05:30
|
|
|
Filter::EmojiFilter,
|
|
|
|
Filter::AutolinkFilter,
|
|
|
|
Filter::ExternalLinkFilter,
|
2018-11-18 11:00:15 +05:30
|
|
|
*reference_filters
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.reference_filters
|
|
|
|
[
|
2021-04-29 21:17:54 +05:30
|
|
|
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
|
2016-01-14 18:37:52 +05:30
|
|
|
]
|
|
|
|
end
|
2019-03-02 22:35:43 +05:30
|
|
|
|
|
|
|
def self.transform_context(context)
|
2019-09-04 21:01:54 +05:30
|
|
|
context = Filter::AssetProxyFilter.transform_context(context)
|
|
|
|
|
2019-03-02 22:35:43 +05:30
|
|
|
super(context).merge(
|
|
|
|
no_sourcepos: true
|
|
|
|
)
|
|
|
|
end
|
2015-12-23 02:04:40 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2020-04-22 19:07:51 +05:30
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
Banzai::Pipeline::SingleLinePipeline.prepend_mod_with('Banzai::Pipeline::SingleLinePipeline')
|