2018-07-23 09:32:32 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-10-06 22:01:42 +00:00
|
|
|
require 'erb'
|
|
|
|
|
|
|
|
module Banzai
|
|
|
|
module Filter
|
|
|
|
# Text filter that escapes these HTML entities: & " < >
|
2016-10-10 14:46:26 +00:00
|
|
|
class HtmlEntityFilter < HTML::Pipeline::TextFilter
|
2016-10-06 22:01:42 +00:00
|
|
|
def call
|
2018-02-15 11:06:57 +00:00
|
|
|
ERB::Util.html_escape(text)
|
2016-10-06 22:01:42 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|