2018-11-18 11:00:15 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-11-03 12:29:30 +05:30
|
|
|
require 'erb'
|
|
|
|
|
|
|
|
module Banzai
|
|
|
|
module Filter
|
|
|
|
# Text filter that escapes these HTML entities: & " < >
|
|
|
|
class HtmlEntityFilter < HTML::Pipeline::TextFilter
|
|
|
|
def call
|
2018-03-27 19:54:05 +05:30
|
|
|
ERB::Util.html_escape(text)
|
2016-11-03 12:29:30 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|