booklab-sml 0.2.4 → 0.2.5
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 +13 -1
- data/lib/booklab/sml/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf3d4e757c389e8021c9df756edcc906b9d8d38c5f155ef274bd7e995cb3cab4
|
4
|
+
data.tar.gz: 4c2fcc7a3156a8f49bc2a7d09b6287b6360ea74df08c691258595fc3a69f0bb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10d089ba2e86f1e6a32b8c68cd83de8a1a4bbc6d3963401810619306688ff8a77c9d317cd6c819f6c4b89831f9700662e27de13ced51b0ff4b47a2b44aba943d
|
7
|
+
data.tar.gz: 71c31b3a9c53fadd12d7b50c3a3b8a3c7e90116142c98d9135aa0a183231ec0ed77c680197227f6822a7263c5485bb4859bad4932fce7efc8228a3a6b6ea6be4
|
@@ -31,12 +31,24 @@ module BookLab::SML::Rules
|
|
31
31
|
if attrs[:align]
|
32
32
|
style["text-align"] = attrs[:align]
|
33
33
|
end
|
34
|
+
|
34
35
|
if attrs[:indent]
|
35
|
-
|
36
|
+
if attrs[:indent].is_a?(Hash)
|
37
|
+
# text-indent
|
38
|
+
text_indent = attrs.dig(:indent, :firstline)
|
39
|
+
style["text-indent"] = "#{4 * INDENT_PX}px" if text_indent
|
40
|
+
|
41
|
+
# padding-left
|
42
|
+
indent_left = attrs.dig(:indent, :left)
|
43
|
+
style["padding-left"] = "#{indent_left * INDENT_PX}px" if indent_left && indent_left > 0
|
44
|
+
end
|
36
45
|
end
|
46
|
+
|
37
47
|
props = css_attrs(style)
|
38
48
|
return "" if props.strip.blank?
|
39
49
|
%( style="#{props}")
|
50
|
+
rescue => e
|
51
|
+
""
|
40
52
|
end
|
41
53
|
|
42
54
|
def self.css_attrs(style)
|
data/lib/booklab/sml/version.rb
CHANGED