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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d7b30ab7d50313d9b5f16fd37bba84207725c8368ba3370a2ef037bdf871f27
4
- data.tar.gz: 730c56224e0961d707db073b550f605e4dd4f39d6a902cbb2af5e9f4533e4785
3
+ metadata.gz: 661d2dbfaa7c3d2186ba6e643f552e46031d27571ca0381607202eca3e4cb0ea
4
+ data.tar.gz: 0ae68c59f5c2efb89f6ae561a50b460d81f50e1b96ae958e2a3602049cd5aed5
5
5
  SHA512:
6
- metadata.gz: 790833d6338e59019751025c38a1b37ffa44ff583dd3f23771bc1015754cc1f047a6da9aa2d28c975191de8451ecc164d7dda412c2df15ca779c27b5aa1bc27a
7
- data.tar.gz: 3ad2faf9178136a477fa4c0952410593219f85e6cacfbc88d1d504fbbe70388184ee62d3a4e84844eb0a8f225ba04845214d41beff68aa665bed12b03f563547
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: :unquote },
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] },
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PrawnHtml # :nodoc:
4
- VERSION = '0.7.0'
4
+ VERSION = '0.7.1'
5
5
  end
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.0
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-06-10 00:00:00.000000000 Z
11
+ date: 2022-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oga