debian-mirror-gitlab/lib/banzai/pipeline/description_pipeline.rb
2016-04-02 18:10:28 +05:30

23 lines
556 B
Ruby

module Banzai
module Pipeline
class DescriptionPipeline < FullPipeline
def self.transform_context(context)
super(context).merge(
# SanitizationFilter
whitelist: whitelist
)
end
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
end
end
end