gitlab-org--gitlab-foss/lib/banzai/pipeline/gfm_pipeline.rb
Rémy Coutable 98e540532c Use a more powerful query to match videos in img tags
Also, always add a link to download videos since video playback is
tricky. Also, it solves the issue with email client not supporting
videos.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-07-19 18:51:09 +02:00

43 lines
1.2 KiB
Ruby

module Banzai
module Pipeline
class GfmPipeline < BasePipeline
def self.filters
@filters ||= FilterArray[
Filter::SyntaxHighlightFilter,
Filter::SanitizationFilter,
Filter::UploadLinkFilter,
Filter::VideoLinkFilter,
Filter::ImageLinkFilter,
Filter::EmojiFilter,
Filter::TableOfContentsFilter,
Filter::AutolinkFilter,
Filter::ExternalLinkFilter,
Filter::UserReferenceFilter,
Filter::IssueReferenceFilter,
Filter::ExternalIssueReferenceFilter,
Filter::MergeRequestReferenceFilter,
Filter::SnippetReferenceFilter,
Filter::CommitRangeReferenceFilter,
Filter::CommitReferenceFilter,
Filter::LabelReferenceFilter,
Filter::MilestoneReferenceFilter,
Filter::TaskListFilter,
Filter::InlineDiffFilter
]
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