debian-mirror-gitlab/lib/banzai/pipeline/incident_management/timeline_event_pipeline.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
919 B
Ruby
Raw Normal View History

2022-07-16 23:28:13 +05:30
# 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,
2022-08-27 11:52:29 +05:30
Filter::SanitizationFilter,
2022-07-16 23:28:13 +05:30
*Banzai::Pipeline::GfmPipeline.reference_filters,
Filter::EmojiFilter,
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