14 lines
271 B
Ruby
14 lines
271 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'erb'
|
|
|
|
module Banzai
|
|
module Filter
|
|
# Text filter that escapes these HTML entities: & " < >
|
|
class HtmlEntityFilter < HTML::Pipeline::TextFilter
|
|
def call
|
|
ERB::Util.html_escape(text)
|
|
end
|
|
end
|
|
end
|
|
end
|