twitter/twitter-text-rb — pull request #11 by keitaf (2011-10-27 06:49:46+00:00)
Title: Modify extract_urls_with_indices() to correctly extract URL w/o protocol 

This fixes a bug in extract_urls_with_indices() to correctly extract URL w/o protocol in CJK text.

Current behavior:
Twitter::Extractor.extract_urls_with_indices("twitter.comテストgoogle.com")
=> [{:url=>"twitter.com", :indices=>[0, 25]}]
# Only 1st URL is extracted. Also indices is incorrect.

Correct behavior:
Twitter::Extractor.extract_urls_with_indices("twitter.comテストgoogle.com")
=> [{:url=>"twitter.com", :indices=>[0, 11]}, {:url=>"google.com", :indices=>[14, 24]}]