prawn-html 0.1.0 → 0.3.2

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.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PrawnHtml # :nodoc:
4
- VERSION = '0.1.0'
4
+ VERSION = '0.3.2'
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.1.0
4
+ version: 0.3.2
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-08-10 00:00:00.000000000 Z
11
+ date: 2021-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oga
@@ -52,10 +52,11 @@ files:
52
52
  - lib/prawn_html/callbacks/strike_through.rb
53
53
  - lib/prawn_html/context.rb
54
54
  - lib/prawn_html/document_renderer.rb
55
- - lib/prawn_html/html_handler.rb
55
+ - lib/prawn_html/html_parser.rb
56
+ - lib/prawn_html/pdf_wrapper.rb
57
+ - lib/prawn_html/tag.rb
56
58
  - lib/prawn_html/tags/a.rb
57
59
  - lib/prawn_html/tags/b.rb
58
- - lib/prawn_html/tags/base.rb
59
60
  - lib/prawn_html/tags/body.rb
60
61
  - lib/prawn_html/tags/br.rb
61
62
  - lib/prawn_html/tags/del.rb
@@ -66,11 +67,13 @@ files:
66
67
  - lib/prawn_html/tags/img.rb
67
68
  - lib/prawn_html/tags/li.rb
68
69
  - lib/prawn_html/tags/mark.rb
70
+ - lib/prawn_html/tags/ol.rb
69
71
  - lib/prawn_html/tags/p.rb
70
72
  - lib/prawn_html/tags/small.rb
71
73
  - lib/prawn_html/tags/span.rb
72
74
  - lib/prawn_html/tags/u.rb
73
75
  - lib/prawn_html/tags/ul.rb
76
+ - lib/prawn_html/utils.rb
74
77
  - lib/prawn_html/version.rb
75
78
  homepage: https://github.com/blocknotes/prawn-html
76
79
  licenses:
@@ -1,54 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module PrawnHtml
4
- module Tags
5
- class Base
6
- attr_reader :attrs, :styles, :tag
7
-
8
- def initialize(tag, attributes = {})
9
- @attrs = Attributes.new(attributes)
10
- @styles = attrs.styles
11
- @tag = tag
12
- attrs.process_styles(extra_attrs) unless extra_attrs.empty?
13
- end
14
-
15
- def apply_doc_styles(document_styles)
16
- selectors = [
17
- tag.to_s,
18
- attrs.hash['class'] ? ".#{attrs.hash['class']}" : nil,
19
- attrs.hash['id'] ? "##{attrs.hash['id']}" : nil
20
- ].compact!
21
- merged_styles = document_styles.each_with_object({}) do |(sel, attributes), res|
22
- res.merge!(attributes) if selectors.include?(sel)
23
- end
24
- styles.merge!(merged_styles)
25
- end
26
-
27
- def block?
28
- false
29
- end
30
-
31
- def extra_attrs
32
- {}
33
- end
34
-
35
- def options
36
- attrs.options
37
- end
38
-
39
- def post_styles
40
- attrs.post_styles
41
- end
42
-
43
- def pre_styles
44
- attrs.pre_styles
45
- end
46
-
47
- class << self
48
- def elements
49
- self::ELEMENTS.each_with_object({}) { |el, list| list[el] = self }
50
- end
51
- end
52
- end
53
- end
54
- end