unescapeElement() in Ruby

By: Jeeva Viewed: 153159 times    

unescapeElement(string, *elements)

Undo escaping such as that done by CGI::escapeElement()

  print CGI::unescapeElement(
          CGI::escapeHTML('<BR><A HREF="url"></A>'), "A", "IMG")
    # "&lt;BR&gt;<A HREF="url"></A>"

  print CGI::unescapeElement(
          CGI::escapeHTML('<BR><A HREF="url"></A>'), ["A", "IMG"])
    # "&lt;BR&gt;<A HREF="url"></A>"

Most Viewed Articles (in Ruby )

Latest Articles (in Ruby)

Comment on this tutorial