spamspanify 1.2.1 → 1.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95b386287edfeb22b32c1e6beb0121a40672aeab
4
- data.tar.gz: b7deffab3beeb8da5507827e9bb595ae5e2311a5
3
+ metadata.gz: 0b53e4f54e750ca830a925a2049695229aaf27fb
4
+ data.tar.gz: 7d7549ba4031df3f611768613146c935f2684ebb
5
5
  SHA512:
6
- metadata.gz: 0a87141ba8ce35091b0185a0375caec6e0b17b57131719899449e5d09482311a3e07649fad5a9f7c2698a0a527f400406c8b9cb7c1fc77742b0330831ba802a3
7
- data.tar.gz: 3c72f1f27af88f3de6ff2fb6c1e81e4373655e8cff96649124bf1a4141beac53a998b52e4937a05dfda385565ee5d23988273beeac865dba30dccb9f56d4ed48
6
+ metadata.gz: dd0eb736ac93ae80b5e2382b8cfd7551ec577fc53170879abbf9afb99f5b64e5b2b12d5b76702380df52523bb41756222bd93b90ee8191cede84e546386ff797
7
+ data.tar.gz: 4481fb069594bccd15427024ff01afede69ba5afcfd85fdc73754f3fdfcc613cd0ad48d3dfd76688307031597d499d1d88754f4cacafb7c7744fb04cf6232b3f
data/lib/spamspanify.rb CHANGED
@@ -4,7 +4,7 @@ require "spamspanify/exceptions"
4
4
 
5
5
  module Spamspanify
6
6
  # TODO split EMAIL_REGEXP in separate local and domain parts
7
- EMAIL_REGEXP = /([\w|&|\-\.])+@([\w|\-\.])+\w+/
7
+ EMAIL_REGEXP = /([\w|(&)|&|\-\.])+@([\w|\-\.])+\w+/
8
8
  MAILTO_REGEXP = /<a\s*href=(\'|\")mailto:#{ EMAIL_REGEXP }(\'|\").*<\/a>/
9
9
 
10
10
  module_function
@@ -1,3 +1,3 @@
1
1
  module Spamspanify
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  end
@@ -26,6 +26,12 @@ describe Spamspanify do
26
26
  "'u'>major&minor.seven</span>@<span class='d'>a-flat.com</span></span>."
27
27
  end
28
28
 
29
+ it "allows an excaped ampersand in the local part of an email address" do
30
+ s = "Email major&amp;minor.seven@a-flat.com."
31
+ expect(s.spamspanify).to eq "Email <span class='spamspan'><span class="\
32
+ "'u'>major&amp;minor.seven</span>@<span class='d'>a-flat.com</span></span>."
33
+ end
34
+
29
35
  describe "should transform html <a href='mailto:..> links as well" do
30
36
  it "when link text is email address" do
31
37
  s = "Email <a href='mailto:b.flat@minor.com'>b.flat@minor.com</a> please."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spamspanify
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corné Verbruggen