debian-mirror-gitlab/lib/banzai/pipeline/incident_management/timeline_event_pipeline.rb
2022-07-17 14:43:12 +02:00

33 lines
919 B
Ruby

# frozen_string_literal: true
module Banzai
module Pipeline
module IncidentManagement
class TimelineEventPipeline < PlainMarkdownPipeline
ALLOWLIST = Banzai::Filter::SanitizationFilter::LIMITED.deep_dup.merge(
elements: %w(p b i strong em pre code a img)
).freeze
def self.filters
@filters ||= FilterArray[
*super,
*Banzai::Pipeline::GfmPipeline.reference_filters,
Filter::EmojiFilter,
Filter::SanitizationFilter,
Filter::ExternalLinkFilter,
Filter::ImageLinkFilter
]
end
def self.transform_context(context)
Filter::AssetProxyFilter.transform_context(context).merge(
only_path: true,
no_sourcepos: true,
allowlist: ALLOWLIST,
link_replaces_image: true
)
end
end
end
end
end