postmortem 0.3.2 → 0.3.4
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/layout/postmortem_index.html.erb +1 -1
- data/lib/postmortem/layout.rb +11 -1
- data/lib/postmortem/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fce57ea2428761eeebebff79349ef7f9b4439c571ba02965a2300e621d5bbd9
|
4
|
+
data.tar.gz: 0673c91fa2fd523744d780ad9f665b8f683dd0bdd11fea0ffb422d210b7aa8bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 825b9b8d1ac22d4cf473a615abfb19328f46c89cec5b4593ef6136928439bd5405c5ce4964ca5b41d47241438a821c49d0042528ae1a8a77840b7bab4f3a04b5
|
7
|
+
data.tar.gz: fd4f91e55706a8c2381dfb9288c4c841fb3bc7383b9bd42b769f1d340bb0a76571d7b5edc736be6e7c9372729ae0438c4dbe28f8e04232fca75d6c1d785381a3
|
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.4
|
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: 2025-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mail
|