diff options
author | Sean McGivern <sean@gitlab.com> | 2018-07-13 11:32:49 +0100 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-07-13 12:37:46 +0100 |
commit | 148128e987e7b6f7d77485b1a5e72b26c53bb607 (patch) | |
tree | bf74dbbe0c99fba1125b639585c2786b456b2d7a /lib | |
parent | a3c8525dc9a69d0e1048c114fd27317dcffc4221 (diff) | |
download | gitlab-ce-148128e987e7b6f7d77485b1a5e72b26c53bb607.tar.gz |
Extract EE-specific lines from Banzai pipelinesextract-ee-specific-banzai-filters
Diffstat (limited to 'lib')
-rw-r--r-- | lib/banzai/pipeline/gfm_pipeline.rb | 18 | ||||
-rw-r--r-- | lib/banzai/pipeline/post_process_pipeline.rb | 12 | ||||
-rw-r--r-- | lib/banzai/pipeline/single_line_pipeline.rb | 8 |
3 files changed, 28 insertions, 10 deletions
diff --git a/lib/banzai/pipeline/gfm_pipeline.rb b/lib/banzai/pipeline/gfm_pipeline.rb index 0d9b874ef85..5dab80dd3eb 100644 --- a/lib/banzai/pipeline/gfm_pipeline.rb +++ b/lib/banzai/pipeline/gfm_pipeline.rb @@ -24,6 +24,17 @@ module Banzai Filter::AutolinkFilter, Filter::ExternalLinkFilter, + *reference_filters, + + Filter::TaskListFilter, + Filter::InlineDiffFilter, + + Filter::SetDirectionFilter + ] + end + + def self.reference_filters + [ Filter::UserReferenceFilter, Filter::IssueReferenceFilter, Filter::ExternalIssueReferenceFilter, @@ -32,12 +43,7 @@ module Banzai Filter::CommitRangeReferenceFilter, Filter::CommitReferenceFilter, Filter::LabelReferenceFilter, - Filter::MilestoneReferenceFilter, - - Filter::TaskListFilter, - Filter::InlineDiffFilter, - - Filter::SetDirectionFilter + Filter::MilestoneReferenceFilter ] end diff --git a/lib/banzai/pipeline/post_process_pipeline.rb b/lib/banzai/pipeline/post_process_pipeline.rb index dcd52bc03c7..0b2e584ef16 100644 --- a/lib/banzai/pipeline/post_process_pipeline.rb +++ b/lib/banzai/pipeline/post_process_pipeline.rb @@ -2,11 +2,17 @@ module Banzai module Pipeline class PostProcessPipeline < BasePipeline def self.filters - FilterArray[ + @filters ||= FilterArray[ + *internal_link_filters, + Filter::AbsoluteLinkFilter + ] + end + + def self.internal_link_filters + [ Filter::RedactorFilter, Filter::RelativeLinkFilter, - Filter::IssuableStateFilter, - Filter::AbsoluteLinkFilter + Filter::IssuableStateFilter ] end diff --git a/lib/banzai/pipeline/single_line_pipeline.rb b/lib/banzai/pipeline/single_line_pipeline.rb index 1929099931b..cd5a6c8875c 100644 --- a/lib/banzai/pipeline/single_line_pipeline.rb +++ b/lib/banzai/pipeline/single_line_pipeline.rb @@ -10,13 +10,19 @@ module Banzai Filter::AutolinkFilter, Filter::ExternalLinkFilter, + *reference_filters + ] + end + + def self.reference_filters + [ Filter::UserReferenceFilter, Filter::IssueReferenceFilter, Filter::ExternalIssueReferenceFilter, Filter::MergeRequestReferenceFilter, Filter::SnippetReferenceFilter, Filter::CommitRangeReferenceFilter, - Filter::CommitReferenceFilter, + Filter::CommitReferenceFilter ] end end |