Skip to content

Instantly share code, notes, and snippets.

@dekokun
Created September 4, 2015 01:40
Show Gist options
  • Save dekokun/31c9d235e96f23938557 to your computer and use it in GitHub Desktop.
Save dekokun/31c9d235e96f23938557 to your computer and use it in GitHub Desktop.
URL hinter動くように
--- url_hinter.rb 2015-09-04 10:39:08.000000000 +0900
+++ url_hinter.rb.bak 2015-09-04 10:38:52.000000000 +0900
@@ -359,10 +359,10 @@
end
def has_url?
- !/https?:\/\/[^  \(\)\r\n]*/.match(remove_color_message).nil?
+ !/https?:\/\/[^  \(\)\r\n]*/.match(remove_color_message.force_encoding("UTF-8")).nil?
end
def urls
- remove_color_message.scan(/https?:\/\/[^  \(\)\r\n]*/).uniq
+ remove_color_message.force_encoding("UTF-8").scan(/https?:\/\/[^  \(\)\r\n]*/).uniq
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment