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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56fc0a29cbc671196acb289d7f236f5b103617373041ec2b23feb34ac78db6de
4
- data.tar.gz: 1db16cd7128beaab435ec2339ed05719453271a0187abd4d007a65fd084d659d
3
+ metadata.gz: cf3d4e757c389e8021c9df756edcc906b9d8d38c5f155ef274bd7e995cb3cab4
4
+ data.tar.gz: 4c2fcc7a3156a8f49bc2a7d09b6287b6360ea74df08c691258595fc3a69f0bb7
5
5
  SHA512:
6
- metadata.gz: 513e3886c4d2d3076dbb3d4d461fb10f166fb4c69edaca308c05c56be2dddb1f7b69c6d0919349db34186482c4de41d1d1724f9585ad505c72c0a88dc9870bce
7
- data.tar.gz: 8ce59ab35e7be50e55e2caaf15f614781aea7ee98ede4fe7bf69ffa14c9832e80f906445b6d4e954ba758709bf7a1553250a2e10dde4f21c0000e4485f242e3b
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
- style["text-indent"] = "#{4 * INDENT_PX}px"
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)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module BookLab
4
4
  module SML
5
- VERSION = "0.2.4"
5
+ VERSION = "0.2.5"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: booklab-sml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee