Skip to content

Instantly share code, notes, and snippets.

View manicolosi's full-sized avatar

Mark A. Nicolosi manicolosi

View GitHub Profile
module HTML
class StathamSanitizer < WhiteListSanitizer
protected
def tokenize(text, options)
super.map do |token|
if token.is_a?(HTML::Tag) && options[:parent].include?(token.name)
token.to_s.gsub(/</, "&lt;")
else