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 +4 -4
- data/lib/postmortem/layout.rb +11 -1
- data/lib/postmortem/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 780f61b6eb5f86e5bfdb462a7956b5153621a65b2d52df46391cca4c7717136f
|
4
|
+
data.tar.gz: 1e455516c635c912c2effbce4781529abdd036196092f9d16eaea4ec1a17e5f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d023d75793d8d8da14f24e2dfa8b1748087c719e2f92df80de5568babb8f3efe89c21d0456e556d2830df50bbe46ab30dadaaabfe1760420a32f1c45b2d14835
|
7
|
+
data.tar.gz: 07bab3669ab537e92532f58d7cfa6b66465e0c3b39af5f73e544cc8099165960e2e7a214ff00d15ad8df05c311fbf4efc76c05ad3205756cf8df8e16397c1cd5
|
data/lib/postmortem/layout.rb
CHANGED
@@ -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 =
|
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?
|
data/lib/postmortem/version.rb
CHANGED
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.
|
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:
|
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.
|
233
|
+
rubygems_version: 3.2.3
|
234
234
|
signing_key:
|
235
235
|
specification_version: 4
|
236
236
|
summary: Development HTML Email Inspection Tool
|