niczak
2/25/2011 - 12:37 AM

TextMate commands to escape/unescape quotes.

TextMate commands to escape/unescape quotes.

#!/usr/bin/env ruby

/* Thanks to @TextMateUser for help with this. */

/* Escape quotes */
puts STDIN.readlines.collect{|line| line.gsub('"','\\"')}

/* Remove escaping */
puts STDIN.readlines.collect{|line| line.gsub('\\"','"')}