Commit 2bf08a48 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'extract-ee-specific-banzai-filters' into 'master'

Extract EE-specific lines from Banzai pipelines

Closes #6065

See merge request gitlab-org/gitlab-ee!6518
parents f8567af4 8c2df842
module EE
module Banzai
module Pipeline
module GfmPipeline
extend ActiveSupport::Concern
class_methods do
def reference_filters
[
::Banzai::Filter::EpicReferenceFilter,
*super
]
end
end
end
end
end
end
module EE
module Banzai
module Pipeline
module PostProcessPipeline
extend ActiveSupport::Concern
class_methods do
def internal_link_filters
[
*super,
::Banzai::Filter::CrossProjectIssuableInformationFilter
]
end
end
end
end
end
end
module EE
module Banzai
module Pipeline
module SingleLinePipeline
extend ActiveSupport::Concern
class_methods do
def reference_filters
[
::Banzai::Filter::EpicReferenceFilter,
*super
]
end
end
end
end
end
end
module Banzai
module Pipeline
class GfmPipeline < BasePipeline
prepend EE::Banzai::Pipeline::GfmPipeline
# These filters convert GitLab Flavored Markdown (GFM) to HTML.
# The handlers defined in app/assets/javascripts/behaviors/markdown/copy_as_gfm.js
# consequently convert that same HTML to GFM to be copied to the clipboard.
......@@ -24,7 +26,17 @@ module Banzai
Filter::AutolinkFilter,
Filter::ExternalLinkFilter,
Filter::EpicReferenceFilter,
*reference_filters,
Filter::TaskListFilter,
Filter::InlineDiffFilter,
Filter::SetDirectionFilter
]
end
def self.reference_filters
[
Filter::UserReferenceFilter,
Filter::IssueReferenceFilter,
Filter::ExternalIssueReferenceFilter,
......@@ -33,12 +45,7 @@ module Banzai
Filter::CommitRangeReferenceFilter,
Filter::CommitReferenceFilter,
Filter::LabelReferenceFilter,
Filter::MilestoneReferenceFilter,
Filter::TaskListFilter,
Filter::InlineDiffFilter,
Filter::SetDirectionFilter
Filter::MilestoneReferenceFilter
]
end
......
module Banzai
module Pipeline
class PostProcessPipeline < BasePipeline
prepend EE::Banzai::Pipeline::PostProcessPipeline
def self.filters
FilterArray[
@filters ||= FilterArray[
*internal_link_filters,
Filter::AbsoluteLinkFilter
]
end
def self.internal_link_filters
[
Filter::RedactorFilter,
Filter::RelativeLinkFilter,
Filter::IssuableStateFilter,
Filter::CrossProjectIssuableInformationFilter,
Filter::AbsoluteLinkFilter
Filter::IssuableStateFilter
]
end
......
module Banzai
module Pipeline
class SingleLinePipeline < GfmPipeline
prepend EE::Banzai::Pipeline::SingleLinePipeline
def self.filters
@filters ||= FilterArray[
Filter::HtmlEntityFilter,
......@@ -10,7 +12,12 @@ module Banzai
Filter::AutolinkFilter,
Filter::ExternalLinkFilter,
Filter::EpicReferenceFilter,
*reference_filters
]
end
def self.reference_filters
[
Filter::UserReferenceFilter,
Filter::IssueReferenceFilter,
Filter::ExternalIssueReferenceFilter,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment