debian-mirror-gitlab/lib/banzai/pipeline/description_pipeline.rb

24 lines
556 B
Ruby
Raw Normal View History

2015-12-23 02:04:40 +05:30
module Banzai
module Pipeline
class DescriptionPipeline < FullPipeline
def self.transform_context(context)
super(context).merge(
# SanitizationFilter
2016-04-02 18:10:28 +05:30
whitelist: whitelist
2015-12-23 02:04:40 +05:30
)
end
2016-04-02 18:10:28 +05:30
private
def self.whitelist
# Descriptions are more heavily sanitized, allowing only a few elements.
# See http://git.io/vkuAN
whitelist = Banzai::Filter::SanitizationFilter::LIMITED
whitelist[:elements] -= %w(pre code img ol ul li)
whitelist
end
2015-12-23 02:04:40 +05:30
end
end
end