postmortem 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7b614038fcdd254411127eb4c6a008c1331d2c8c9b660064b655e404efcb628
4
- data.tar.gz: 2e6078c75b0b0c2bb7bfb52189baa7773a3f9a2a9b5d7f0f6a805fc9624b1dd9
3
+ metadata.gz: 780f61b6eb5f86e5bfdb462a7956b5153621a65b2d52df46391cca4c7717136f
4
+ data.tar.gz: 1e455516c635c912c2effbce4781529abdd036196092f9d16eaea4ec1a17e5f2
5
5
  SHA512:
6
- metadata.gz: ae4256c6ff0bc3602672abc0caa917b3f25b3e3d463c3557c6f1a15eb783d465398d11eaec0358c531b1d4cc6cbf7c9438169cbb9a594f942f52233b63065ed8
7
- data.tar.gz: eac1a7af623d3e0f8eb880633c35a25cdef88b6fd9c06dad575ba983a88ddf0a74ef08fbcca36f2dc898d360d6bed583c0bd3e8ba39ac666bfb1d61793d24142
6
+ metadata.gz: d023d75793d8d8da14f24e2dfa8b1748087c719e2f92df80de5568babb8f3efe89c21d0456e556d2830df50bbe46ab30dadaaabfe1760420a32f1c45b2d14835
7
+ data.tar.gz: 07bab3669ab537e92532f58d7cfa6b66465e0c3b39af5f73e544cc8099165960e2e7a214ff00d15ad8df05c311fbf4efc76c05ad3205756cf8df8e16397c1cd5
@@ -54,7 +54,7 @@ module Postmortem
54
54
  def with_inlined_images(body)
55
55
  parsed = Nokogiri::HTML.parse(body)
56
56
  parsed.css('img').each do |img|
57
- uri = try_uri(img['src'])
57
+ uri = extract_image_uri(img)
58
58
  next unless local_file?(uri)
59
59
 
60
60
  path = located_image(uri)
@@ -63,6 +63,16 @@ module Postmortem
63
63
  parsed.to_s
64
64
  end
65
65
 
66
+ def extract_image_uri(img)
67
+ src_uri = try_uri(img['src'])
68
+ return src_uri if src_uri&.path.present?
69
+
70
+ original_src_uri = try_uri(img['data-originalsrc'])
71
+ return original_src_uri if original_src_uri&.path.present?
72
+
73
+ nil
74
+ end
75
+
66
76
  def local_file?(uri)
67
77
  return false if uri.nil?
68
78
  return true if uri.host.nil?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Postmortem
4
- VERSION = '0.3.2'
4
+ VERSION = '0.3.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postmortem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Farrell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-29 00:00:00.000000000 Z
11
+ date: 2024-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mail
@@ -230,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
230
  - !ruby/object:Gem::Version
231
231
  version: '0'
232
232
  requirements: []
233
- rubygems_version: 3.0.3.1
233
+ rubygems_version: 3.2.3
234
234
  signing_key:
235
235
  specification_version: 4
236
236
  summary: Development HTML Email Inspection Tool