BigW Consortium Gitlab

gfm_pipeline.rb 1.21 KB
Newer Older
1 2 3 4
module Banzai
  module Pipeline
    class GfmPipeline < BasePipeline
      def self.filters
5
        @filters ||= FilterArray[
6 7 8 9
          Filter::SyntaxHighlightFilter,
          Filter::SanitizationFilter,

          Filter::UploadLinkFilter,
10
          Filter::VideoLinkFilter,
11
          Filter::ImageLinkFilter,
12 13 14 15 16 17 18 19 20 21 22 23 24
          Filter::EmojiFilter,
          Filter::TableOfContentsFilter,
          Filter::AutolinkFilter,
          Filter::ExternalLinkFilter,

          Filter::UserReferenceFilter,
          Filter::IssueReferenceFilter,
          Filter::ExternalIssueReferenceFilter,
          Filter::MergeRequestReferenceFilter,
          Filter::SnippetReferenceFilter,
          Filter::CommitRangeReferenceFilter,
          Filter::CommitReferenceFilter,
          Filter::LabelReferenceFilter,
25
          Filter::MilestoneReferenceFilter,
26

27
          Filter::TaskListFilter,
28 29 30
          Filter::InlineDiffFilter,

          Filter::SetDirectionFilter
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
        ]
      end

      def self.transform_context(context)
        context.merge(
          only_path: true,

          # EmojiFilter
          asset_host: Gitlab::Application.config.asset_host,
          asset_root: Gitlab.config.gitlab.base_url
        )
      end
    end
  end
end