twitter-text 1.13.0 → 1.13.3
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.
- checksums.yaml +4 -4
- data/lib/twitter-text/regex.rb +5 -5
- data/spec/validation_spec.rb +1 -1
- data/twitter-text.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 93fd2b0a12b6a70531556e0d2d23386009900f42
|
|
4
|
+
data.tar.gz: 5fd5a7c55403f171491e492b964300adf4b19b2f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5d7bed341ec7a7e43be70d49bdc9ba2702350aa1981d75893eb52275e91eb7dee16daeb756372cf03115c6fc3dcd60bb2a1af9d666cd66699607aba64212537b
|
|
7
|
+
data.tar.gz: 2a4fe2a37fbfec1ef9fa6aeb00e25a42db5f8f141fc08ef1af40298c6f813b5b36f9410b53b3aa9a0de2c6062a61e8a88889d05cb542babedd4a0da38e5ce4c8
|
data/lib/twitter-text/regex.rb
CHANGED
|
@@ -105,10 +105,10 @@ module Twitter
|
|
|
105
105
|
|
|
106
106
|
# A hashtag must contain at least one unicode letter or mark, as well as numbers, underscores, and select special characters.
|
|
107
107
|
HASHTAG_ALPHA = /[\p{L}\p{M}]/
|
|
108
|
-
HASHTAG_ALPHANUMERIC = /[\p{L}\p{M}\p{Nd}_\u200c\u200d\u0482\ua673\ua67e\u05be\u05f3\u05f4\u309b\u309c\u30a0\u30fb\u3003\u0f0b\u0f0c\u00b7]/
|
|
108
|
+
HASHTAG_ALPHANUMERIC = /[\p{L}\p{M}\p{Nd}_\u200c\u200d\u0482\ua673\ua67e\u05be\u05f3\u05f4\uff5e\u301c\u309b\u309c\u30a0\u30fb\u3003\u0f0b\u0f0c\u00b7]/
|
|
109
109
|
HASHTAG_BOUNDARY = /\A|\z|[^&\p{L}\p{M}\p{Nd}_\u200c\u200d\u0482\ua673\ua67e\u05be\u05f3\u05f4\u309b\u309c\u30a0\u30fb\u3003\u0f0b\u0f0c\u00b7]/
|
|
110
110
|
|
|
111
|
-
HASHTAG = /(#{HASHTAG_BOUNDARY})(#|#)(#{HASHTAG_ALPHANUMERIC}*#{HASHTAG_ALPHA}#{HASHTAG_ALPHANUMERIC}*)/io
|
|
111
|
+
HASHTAG = /(#{HASHTAG_BOUNDARY})(#|#)(?!\ufe0f|\u20e3)(#{HASHTAG_ALPHANUMERIC}*#{HASHTAG_ALPHA}#{HASHTAG_ALPHANUMERIC}*)/io
|
|
112
112
|
|
|
113
113
|
REGEXEN[:valid_hashtag] = /#{HASHTAG}/io
|
|
114
114
|
# Used in Extractor for final filtering
|
|
@@ -175,7 +175,7 @@ module Twitter
|
|
|
175
175
|
|
|
176
176
|
REGEXEN[:valid_port_number] = /[0-9]+/
|
|
177
177
|
|
|
178
|
-
REGEXEN[:valid_general_url_path_chars] = /[a-
|
|
178
|
+
REGEXEN[:valid_general_url_path_chars] = /[a-z\p{Cyrillic}0-9!\*';:=\+\,\.\$\/%#\[\]\-_~&\|@#{LATIN_ACCENTS}]/io
|
|
179
179
|
# Allow URL paths to contain up to two nested levels of balanced parens
|
|
180
180
|
# 1. Used in Wikipedia URLs like /Primer_(film)
|
|
181
181
|
# 2. Used in IIS sessions like /S(dfd346)/
|
|
@@ -198,7 +198,7 @@ module Twitter
|
|
|
198
198
|
/iox
|
|
199
199
|
# Valid end-of-path chracters (so /foo. does not gobble the period).
|
|
200
200
|
# 1. Allow =&# for empty URL parameters and other URL-join artifacts
|
|
201
|
-
REGEXEN[:valid_url_path_ending_chars] = /[a-
|
|
201
|
+
REGEXEN[:valid_url_path_ending_chars] = /[a-z\p{Cyrillic}0-9=_#\/\+\-#{LATIN_ACCENTS}]|(?:#{REGEXEN[:valid_url_balanced_parens]})/io
|
|
202
202
|
REGEXEN[:valid_url_path] = /(?:
|
|
203
203
|
(?:
|
|
204
204
|
#{REGEXEN[:valid_general_url_path_chars]}*
|
|
@@ -226,7 +226,7 @@ module Twitter
|
|
|
226
226
|
REGEXEN[:valid_cashtag] = /(^|#{REGEXEN[:spaces]})(\$)(#{REGEXEN[:cashtag]})(?=$|\s|[#{PUNCTUATION_CHARS}])/i
|
|
227
227
|
|
|
228
228
|
# These URL validation pattern strings are based on the ABNF from RFC 3986
|
|
229
|
-
REGEXEN[:validate_url_unreserved] = /[a-
|
|
229
|
+
REGEXEN[:validate_url_unreserved] = /[a-z\p{Cyrillic}0-9\-._~]/i
|
|
230
230
|
REGEXEN[:validate_url_pct_encoded] = /(?:%[0-9a-f]{2})/i
|
|
231
231
|
REGEXEN[:validate_url_sub_delims] = /[!$&'()*+,;=]/i
|
|
232
232
|
REGEXEN[:validate_url_pchar] = /(?:
|
data/spec/validation_spec.rb
CHANGED
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.13.
|
|
5
|
+
s.version = "1.13.3"
|
|
6
6
|
s.authors = ["Matt Sanford", "Patrick Ewing", "Ben Cherry", "Britt Selvitelle",
|
|
7
7
|
"Raffi Krikorian", "J.P. Cummins", "Yoshimasa Niwa", "Keita Fujii", "James Koval"]
|
|
8
8
|
s.email = ["matt@twitter.com", "patrick.henry.ewing@gmail.com", "bcherry@gmail.com", "bs@brittspace.com",
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: twitter-text
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.13.
|
|
4
|
+
version: 1.13.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matt Sanford
|
|
@@ -16,7 +16,7 @@ authors:
|
|
|
16
16
|
autorequire:
|
|
17
17
|
bindir: bin
|
|
18
18
|
cert_chain: []
|
|
19
|
-
date:
|
|
19
|
+
date: 2016-02-01 00:00:00.000000000 Z
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|
|
22
22
|
name: multi_json
|
|
@@ -184,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
184
184
|
version: '0'
|
|
185
185
|
requirements: []
|
|
186
186
|
rubyforge_project:
|
|
187
|
-
rubygems_version: 2.4.
|
|
187
|
+
rubygems_version: 2.4.3
|
|
188
188
|
signing_key:
|
|
189
189
|
specification_version: 4
|
|
190
190
|
summary: Twitter text handling library
|