prawn-html 0.6.2 → 0.6.4

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: 105884df1bf42d6aa44ff0a102a025960740c0d5a771c27e75949113cd7b9b70
4
- data.tar.gz: abe3998f3f65cd2b421280d99151f18e321ac650dd8abed26260062e6f8e455a
3
+ metadata.gz: c773502449714d4f0a6f2401721ba67a349731ef9f0c525216864b355fbe76c8
4
+ data.tar.gz: 8857a7761f343367a4c6496757c767b6b62b46d0d840df96a7d545c3693c744f
5
5
  SHA512:
6
- metadata.gz: 0dc20b1ee2c6bd1321b4359e31e217cea923c68f5f3af242b097d56d9492f198e1df6af263cadcf75978c83700a90cad3cfbae08d25e9b0ebb39ddea6ad2c059
7
- data.tar.gz: 88180bff0e1aac88d566911fafac9c6b6ae799eee6c1f77948f0bc811825f03c2e7ca2c8b1bf8962dc60e27ba355904d77289e3870e1c3faecd8c362e6536237
6
+ metadata.gz: 51be5bfbbf4427f6124a4a00cfb399017d6b806d8d3d2bb228fc81b7547a3cbaffe535767c5270a2666bed0a9abd89099d156dd79b1ea638d39101e528207be0
7
+ data.tar.gz: 520221561fc067919e098349fe6fab940290f6de419b37722679eacbb959055700620539c067d6a57786e7d4396bd0a4659e0f95428b09a96c3a93c55e174bda
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Prawn HTML
2
2
  [![gem version](https://badge.fury.io/rb/prawn-html.svg)](https://rubygems.org/gems/prawn-html)
3
+ [![gem downloads](https://badgen.net/rubygems/dt/prawn-html)](https://rubygems.org/gems/prawn-html)
4
+ [![maintainability](https://api.codeclimate.com/v1/badges/db674db00817d56ca1e9/maintainability)](https://codeclimate.com/github/blocknotes/prawn-html/maintainability)
3
5
  [![linters](https://github.com/blocknotes/prawn-html/actions/workflows/linters.yml/badge.svg)](https://github.com/blocknotes/prawn-html/actions/workflows/linters.yml)
4
6
  [![specs](https://github.com/blocknotes/prawn-html/actions/workflows/specs.yml/badge.svg)](https://github.com/blocknotes/prawn-html/actions/workflows/specs.yml)
5
7
 
@@ -106,7 +106,8 @@ module PrawnHtml
106
106
  end
107
107
 
108
108
  def prepare_text(content)
109
- text = context.before_content ? ::Oga::HTML::Entities.decode(context.before_content) : ''
109
+ before_content = context.before_content
110
+ text = before_content ? ::Oga::HTML::Entities.decode(before_content) : ''
110
111
  return (@last_text = text + content) if context.white_space_pre?
111
112
 
112
113
  content = content.lstrip if @last_text[-1] == ' ' || @last_tag_open
@@ -13,7 +13,9 @@ module PrawnHtml
13
13
  end
14
14
 
15
15
  def before_content
16
- @counter ? "#{@counter}. " : "#{@symbol} "
16
+ return if @before_content_once
17
+
18
+ @before_content_once = @counter ? "#{@counter}. " : "#{@symbol} "
17
19
  end
18
20
 
19
21
  def block_styles
@@ -45,7 +45,7 @@ module PrawnHtml
45
45
 
46
46
  if val.match /\A#([a-f0-9]{3})\Z/ # rubocop:disable Performance/RedundantMatch
47
47
  r, g, b = Regexp.last_match[1].chars
48
- return r * 2 + g * 2 + b * 2
48
+ return (r * 2) + (g * 2) + (b * 2)
49
49
  end
50
50
  if val.match /\Argb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)\Z/ # rubocop:disable Performance/RedundantMatch
51
51
  r, g, b = Regexp.last_match[1..3].map { |v| v.to_i.to_s(16) }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PrawnHtml # :nodoc:
4
- VERSION = '0.6.2'
4
+ VERSION = '0.6.4'
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.6.2
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattia Roccoberton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-20 00:00:00.000000000 Z
11
+ date: 2022-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oga
@@ -83,7 +83,10 @@ files:
83
83
  homepage: https://github.com/blocknotes/prawn-html
84
84
  licenses:
85
85
  - MIT
86
- metadata: {}
86
+ metadata:
87
+ homepage_uri: https://github.com/blocknotes/prawn-html
88
+ source_code_uri: https://github.com/blocknotes/prawn-html
89
+ rubygems_mfa_required: 'true'
87
90
  post_install_message:
88
91
  rdoc_options: []
89
92
  require_paths:
@@ -99,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
102
  - !ruby/object:Gem::Version
100
103
  version: '0'
101
104
  requirements: []
102
- rubygems_version: 3.1.4
105
+ rubygems_version: 3.1.6
103
106
  signing_key:
104
107
  specification_version: 4
105
108
  summary: Prawn PDF - HTML renderer