class Roda::RodaPlugins::ErubisEscaping::UnsafeClassEscaper
classes marked as safe.
Escaper which escapes by default, but does not escape instances of
def escape_xml(string)
classes, escape it, otherwise return it verbatim. If the
If the string given is not an instance of one of the safe
def escape_xml(string) unless string.is_a?(String) string = string.to_s end if @safe_classes.any?{|c| string.is_a?(c)} string else Escaper.escape_xml(string) end end
def initialize(safe_classes)
def initialize(safe_classes) @safe_classes = Array(safe_classes).freeze freeze end