twitter-text 1.4.14 → 1.4.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/autolink.rb +8 -1
  2. data/twitter-text.gemspec +1 -1
  3. metadata +4 -4
data/lib/autolink.rb CHANGED
@@ -152,6 +152,13 @@ module Twitter
152
152
  html_attrs = html_attrs_for_options(options)
153
153
 
154
154
  Twitter::Rewriter.rewrite_urls(text) do |url|
155
+ # In the case of t.co URLs, don't allow additional path characters
156
+ after = ""
157
+ if url =~ Twitter::Regex[:valid_tco_url]
158
+ url = $&
159
+ after = $'
160
+ end
161
+
155
162
  href = if options[:link_url_block]
156
163
  options.delete(:link_url_block).call(url)
157
164
  else
@@ -163,7 +170,7 @@ module Twitter
163
170
  display_url = url_entities[url][:display_url]
164
171
  end
165
172
 
166
- %(<a href="#{href}"#{html_attrs}>#{html_escape(display_url)}</a>)
173
+ %(<a href="#{href}"#{html_attrs}>#{html_escape(display_url)}</a>#{after})
167
174
  end
168
175
  end
169
176
 
data/twitter-text.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "twitter-text"
5
- s.version = "1.4.14"
5
+ s.version = "1.4.15"
6
6
  s.authors = ["Matt Sanford", "Patrick Ewing", "Ben Cherry", "Britt Selvitelle",
7
7
  "Raffi Krikorian", "J.P. Cummins", "Yoshimasa Niwa", "Keita Fujii"]
8
8
  s.email = ["matt@twitter.com", "patrick.henry.ewing@gmail.com", "bcherry@gmail.com", "bs@brittspace.com",
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter-text
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 4
9
- - 14
10
- version: 1.4.14
9
+ - 15
10
+ version: 1.4.15
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt Sanford
@@ -22,7 +22,7 @@ autorequire:
22
22
  bindir: bin
23
23
  cert_chain: []
24
24
 
25
- date: 2011-12-01 00:00:00 -08:00
25
+ date: 2011-12-02 00:00:00 -08:00
26
26
  default_executable:
27
27
  dependencies:
28
28
  - !ruby/object:Gem::Dependency