Permalink
Browse files

safe-quote of typing allows for typing of quotation marks

  • Loading branch information...
jashmenn committed May 13, 2009
1 parent 9a0616a commit 1a7f18f9d9a79256bf154cf14788d936515a582f
Showing with 6 additions and 1 deletion.
  1. +5 −0 lib/castanaut/ext/string.rb
  2. +1 −1 lib/castanaut/movie.rb
@@ -0,0 +1,5 @@
+class String
+ def safe_quote
+ self.gsub(/['"]/, '\\\"')
+ end
+end
View
@@ -156,7 +156,7 @@ def drag(*options)
def type(str, opts = {})
opts[:speed] = 50 unless opts[:speed].nil?
- compatible_call :type, str, opts
+ compatible_call :type, str.safe_quote, opts
end
# TODO - determine which #type to use

0 comments on commit 1a7f18f

Please sign in to comment.