booklab-sml 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/booklab/sml/rules/base.rb +3 -0
- data/lib/booklab/sml/rules/image.rb +3 -4
- data/lib/booklab/sml/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: 6f2be0239f156ad88b94d4ea2b004323ad2103fc5f40a464978888218368757b
|
4
|
+
data.tar.gz: 1c8216e99a9c7726d73babb29c9131bfaad8b43edf6e273a2844458b8ba697cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3036a182310d3de012c563b8caec72944e268995fc264a77a8b1aee0e635ab296de19c0b703551f11ef427a6b76dfcd1560d3056947d61d83e1c92a3ae53e2ee
|
7
|
+
data.tar.gz: c42ae23213f09e67f32e551be9ca9af2c48ddef2ea745848f0f2c0e600469317abaee72a40747ec1f06208f1c22042e927a45d8e1165ea0943ca0efe92e0717e
|
@@ -60,6 +60,9 @@ module BookLab::SML::Rules
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def self.html_attrs(attrs)
|
63
|
+
attrs[:width] = nil if attrs[:width].to_i == 0
|
64
|
+
attrs[:height] = nil if attrs[:height].to_i == 0
|
65
|
+
|
63
66
|
props = attrs.map { |k, v| v.present? ? %(#{k}="#{v}") : nil }.compact.join(" ")
|
64
67
|
%( #{props})
|
65
68
|
end
|
@@ -12,15 +12,14 @@ module BookLab::SML::Rules
|
|
12
12
|
|
13
13
|
return attrs[:name] if attrs[:src].blank?
|
14
14
|
|
15
|
-
|
15
|
+
attr_html = html_attrs(
|
16
16
|
src: attrs[:src],
|
17
17
|
alt: attrs[:name],
|
18
18
|
width: attrs[:width],
|
19
19
|
height: attrs[:height]
|
20
|
-
|
20
|
+
)
|
21
21
|
|
22
|
-
|
23
|
-
%(<img #{attr_html}>)
|
22
|
+
%(<img#{attr_html}>)
|
24
23
|
end
|
25
24
|
end
|
26
25
|
end
|
data/lib/booklab/sml/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: booklab-sml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|