Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
CGI::Util#unescape_element
unescape_element(string, *elements)
lib/cgi/util.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/cgi/util.rb, line 204
def unescapeElement(string, *elements)
elements = elements[0] if elements[0].kind_of?(Array)
unless elements.empty?
string.gsub(/<\/?(?:#{elements.join("|")})(?!\w)(?:.|\n)*?>/i) do
unescapeHTML($&)
end
else
string
end
end
Alias of #unescapeElement
Synonym for CGI.unescapeElement(str)