public Method

Utils.html_escape(s)

escape ’&’, ’"’, ’<’ and ’>’ for use in HTML.

Source Code

# File rss/utils.rb, line 18
def html_escape(s)
  s.to_s.gsub(/&/, "&amp;").gsub(/\"/, "&quot;").gsub(/>/, "&gt;").gsub(/</, "&lt;")
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.