Friday, February 17, 2006

h :: html_escape

Ruby-Language

Today, I was looking for html_escape function and found it at the above URL:

197: def html_escape(s)
198: s.to_s.gsub(/&/n, '&').gsub(/\"/n, '"').gsub(/>/n, '>').gsub(/</n, '<')
199: end
200: alias h html_escape

1 Comments:

At 5:09 PM, Blogger Unknown said...

Use ERB::Util::h instead, it's already there.

 

Post a Comment

<< Home

eXTReMe Tracker