eml_to_pdf_ext 0.5.6 → 0.5.7

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: 992328b3cdfaa1ee5bf54e93689a225ebb46bc40
4
- data.tar.gz: 7924a707e8ed56dd358192fcd708a06eeae9c72b
3
+ metadata.gz: ab5a72a56e86f3cc120f79c2a20ec295938e77d9
4
+ data.tar.gz: 3ce8b71ace5b0508daf234db5f66ae3386e3799f
5
5
  SHA512:
6
- metadata.gz: 9f374e0e6541303ae2225613454296327614df9a635d2945844bbf3f26108403df6fb59e1f6a560d66806a1d050035ffc779904e1250e95ef6f6b23fbb50fe16
7
- data.tar.gz: dc57489286f9fa98063fc146ee80cf329034051fa654e121cc642aeea2a0f7e440f53cdfa6e037bd79e67552d1b9396f534dff5e722e5a1253edaa9d9806b2b0
6
+ metadata.gz: 7f13131567caaac7cf148a4ecca36be88e00038d059762e0951b9fcabaa4f8d6947b15e20ca9961de12a8eccd9a7a590be11ece2c5d78fc5912d2164b2d97637
7
+ data.tar.gz: 0a08e4182b2eea3c0ae166cf0d86e1b047514f16d8b6cb8ce2fbbd1e8961f6c3601c3d0cfa22e49c63f2e5a91760070b951b50d349db83537cbd782eb158f4f1
@@ -78,11 +78,21 @@ module EmlToPdf
78
78
 
79
79
  def disable_links(html)
80
80
  doc = Nokogiri::HTML(html)
81
- doc.css('a').reject do |x|
81
+
82
+ links = doc.css('a')
83
+
84
+ links.select do |x|
85
+ allowed_formats.any? { |format| x['href'].start_with?(format) }
86
+ end.each do |x|
87
+ x['target'] = ''
88
+ end
89
+
90
+ links.reject do |x|
82
91
  allowed_formats.any? { |format| x['href'].start_with?(format) }
83
92
  end.each do |x|
84
93
  x['target'] = '_blank'
85
94
  end
95
+
86
96
  doc.to_html
87
97
  end
88
98
 
@@ -1,3 +1,3 @@
1
1
  module EmlToPdf
2
- VERSION = '0.5.6'
2
+ VERSION = '0.5.7'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eml_to_pdf_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yves Siegrist