prawn-html 0.7.0 → 0.7.1
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/lib/prawn_html/attributes.rb +1 -1
- data/lib/prawn_html/utils.rb +11 -1
- data/lib/prawn_html/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: 661d2dbfaa7c3d2186ba6e643f552e46031d27571ca0381607202eca3e4cb0ea
|
|
4
|
+
data.tar.gz: 0ae68c59f5c2efb89f6ae561a50b460d81f50e1b96ae958e2a3602049cd5aed5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7ec9c6055dbb336fe9b845ecd274bc6524a0bcaa5a5e0cf2911f01506c4c8d6a6c5c50ab70140f6c8bac134764a79ee46dfa7c80ccadb043d48f656c1f4f3af1
|
|
7
|
+
data.tar.gz: 4c48e9cca75c7ec86d28c0c9304c1ff92b98f14389007da6e55189092c5e8503d77bd2d5cc379e8f0aa333850d2e6cc79ce19a2a4921778c2289afb1f186cac1
|
|
@@ -18,7 +18,7 @@ module PrawnHtml
|
|
|
18
18
|
# text node styles
|
|
19
19
|
'background' => { key: :callback, set: :callback_background },
|
|
20
20
|
'color' => { key: :color, set: :convert_color },
|
|
21
|
-
'font-family' => { key: :font, set: :
|
|
21
|
+
'font-family' => { key: :font, set: :filter_font_family },
|
|
22
22
|
'font-size' => { key: :size, set: :convert_size },
|
|
23
23
|
'font-style' => { key: :styles, set: :append_styles, values: %i[italic] },
|
|
24
24
|
'font-weight' => { key: :styles, set: :append_styles, values: %i[bold] },
|
data/lib/prawn_html/utils.rb
CHANGED
|
@@ -100,6 +100,16 @@ module PrawnHtml
|
|
|
100
100
|
value
|
|
101
101
|
end
|
|
102
102
|
|
|
103
|
+
# Filter font family
|
|
104
|
+
#
|
|
105
|
+
# @param value [String] string value
|
|
106
|
+
#
|
|
107
|
+
# @return [Symbol] unquoted font family or nil if the input value is 'inherit'
|
|
108
|
+
def filter_font_family(value, options: nil)
|
|
109
|
+
result = unquote(value, options: options)
|
|
110
|
+
result == 'inherit' ? nil : result
|
|
111
|
+
end
|
|
112
|
+
|
|
103
113
|
# Normalize a style value
|
|
104
114
|
#
|
|
105
115
|
# @param value [String] string value
|
|
@@ -124,6 +134,6 @@ module PrawnHtml
|
|
|
124
134
|
end
|
|
125
135
|
|
|
126
136
|
module_function :callback_background, :callback_strike_through, :convert_color, :convert_float, :convert_size,
|
|
127
|
-
:convert_symbol, :copy_value, :normalize_style, :unquote
|
|
137
|
+
:convert_symbol, :copy_value, :filter_font_family, :normalize_style, :unquote
|
|
128
138
|
end
|
|
129
139
|
end
|
data/lib/prawn_html/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: prawn-html
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mattia Roccoberton
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-09-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: oga
|