Skip to content
accelerando

Don’t make that sad smilie cry even more

Escaping single quotes in ruby is the same mess as in java:

puts ":'(".gsub('\'', '\\\\\'')

I needed this to make the smilies after my comment box (here) clickable.

Shortly after that, i found escape_javascript, maybe it still comes in handy.

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*

*

Close
E-mail It