roadie 3.5.0 → 3.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +12 -2
- data/lib/roadie/markup_improver.rb +7 -0
- data/lib/roadie/version.rb +1 -1
- data/spec/lib/roadie/markup_improver_spec.rb +1 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19c2bb2df5f06249e20336bee272088f2224749fcb20741c411647428221e20e
|
4
|
+
data.tar.gz: cd7e290f724bf71fd8b56d8f013ebc2dd246b5594fc730d5899639d1dbdada38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8767e97ed3592ff69e969d646537775b9a0c571d62f54bb02555e102f5acedf5813435d0f4b1b58b52adb4187608cfe33020a7019c98aebd8ad5077ef3e3b4e8
|
7
|
+
data.tar.gz: 220fdd872e42acea4e4aebe9dc04f34d3a9e996254d5135af4663d98534362ade3b0d1c21368afd6c046282814b4f0d061f8e20f14451d295fb511f0c4888366
|
data/Changelog.md
CHANGED
@@ -1,8 +1,18 @@
|
|
1
1
|
### dev
|
2
2
|
|
3
|
-
|
3
|
+
### dev
|
4
|
+
|
5
|
+
[full changelog](https://github.com/Mange/roadie/compare/v3.5.1...master)
|
6
|
+
|
7
|
+
* Nothing yet.
|
8
|
+
|
9
|
+
### 3.5.1
|
10
|
+
|
11
|
+
[full changelog](https://github.com/Mange/roadie/compare/v3.5.0...v3.5.1)
|
4
12
|
|
5
|
-
|
13
|
+
* Gracefully handle empty string email body, such as those provided by
|
14
|
+
`ActionMailer::Base::NullMail` objects - [adamkiczula (Adam
|
15
|
+
Kiczula)](https://github.com/adamkiczula) (#163).
|
6
16
|
|
7
17
|
### 3.5.0
|
8
18
|
|
@@ -25,6 +25,7 @@ module Roadie
|
|
25
25
|
# @return [nil] passed DOM will be mutated
|
26
26
|
def improve
|
27
27
|
ensure_doctype_present
|
28
|
+
ensure_html_element_present
|
28
29
|
head = ensure_head_element_present
|
29
30
|
ensure_declared_charset head
|
30
31
|
end
|
@@ -48,6 +49,12 @@ module Roadie
|
|
48
49
|
defined?(JRuby)
|
49
50
|
end
|
50
51
|
|
52
|
+
def ensure_html_element_present
|
53
|
+
return if dom.at_xpath('html')
|
54
|
+
html = Nokogiri::XML::Node.new 'html', dom
|
55
|
+
dom << html
|
56
|
+
end
|
57
|
+
|
51
58
|
def ensure_head_element_present
|
52
59
|
if (head = dom.at_xpath('html/head'))
|
53
60
|
head
|
data/lib/roadie/version.rb
CHANGED
@@ -36,6 +36,7 @@ module Roadie
|
|
36
36
|
|
37
37
|
describe "basic HTML structure" do
|
38
38
|
it "inserts a <html> element as the root" do
|
39
|
+
expect(improve("")).to have_selector("html")
|
39
40
|
expect(improve("<h1>Hey!</h1>")).to have_selector("html h1")
|
40
41
|
expect(improve("<html></html>").css('html').size).to eq(1)
|
41
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roadie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.
|
4
|
+
version: 3.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Magnus Bergmark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -181,8 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
181
|
- !ruby/object:Gem::Version
|
182
182
|
version: '0'
|
183
183
|
requirements: []
|
184
|
-
|
185
|
-
rubygems_version: 2.7.3
|
184
|
+
rubygems_version: 3.0.2
|
186
185
|
signing_key:
|
187
186
|
specification_version: 4
|
188
187
|
summary: Making HTML emails comfortable for the Ruby rockstars
|