prawn-markup 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/prawn/markup/processor.rb +10 -8
- data/lib/prawn/markup/processor/lists.rb +3 -1
- data/lib/prawn/markup/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: fcd47aaef564239231b4546e4122f9f15625c15de5aa3d91bf0e3933e62d46ce
|
4
|
+
data.tar.gz: 77d0fa0b0b8261d6e3c0a8b7df75f797b31914c761c32dc229ba93edf269a587
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 395187b2fe33613d41bb9f4ac89f9b370cff0ac2a01212c96d5c88eea57e88a255e93a44e519f723b0955b468eb4896da06b7094ba3aa046302ab6733f3b8e6a
|
7
|
+
data.tar.gz: fd2c752f5eb61d1029371a4d2cd2476168476696d464853ba288ca263b6a8c903cb367a8f29dbc104f8e2d809b1f7cca02c779e863e9bd10385849be283d51db
|
@@ -39,6 +39,7 @@ module Prawn
|
|
39
39
|
prepend Prawn::Markup::Processor::Lists
|
40
40
|
|
41
41
|
def initialize(pdf, options = {})
|
42
|
+
super()
|
42
43
|
@pdf = pdf
|
43
44
|
@options = options
|
44
45
|
end
|
@@ -52,10 +53,8 @@ module Prawn
|
|
52
53
|
end
|
53
54
|
|
54
55
|
def start_element(name, attrs = [])
|
55
|
-
stack.push(name: name, attrs:
|
56
|
-
if
|
57
|
-
send("start_#{name}") if respond_to?("start_#{name}", true)
|
58
|
-
end
|
56
|
+
stack.push(name: name, attrs: attrs.to_h)
|
57
|
+
send("start_#{name}") if known_element?(name) && respond_to?("start_#{name}", true)
|
59
58
|
end
|
60
59
|
|
61
60
|
def end_element(name)
|
@@ -69,11 +68,11 @@ module Prawn
|
|
69
68
|
end
|
70
69
|
|
71
70
|
def error(string)
|
72
|
-
logger.info(
|
71
|
+
logger.info("SAX parsing error: #{string.strip}") if logger
|
73
72
|
end
|
74
73
|
|
75
74
|
def warning(string)
|
76
|
-
logger.info(
|
75
|
+
logger.info("SAX parsing warning: #{string.strip}") if logger
|
77
76
|
end
|
78
77
|
|
79
78
|
private
|
@@ -85,6 +84,10 @@ module Prawn
|
|
85
84
|
@text_buffer = +''
|
86
85
|
end
|
87
86
|
|
87
|
+
def known_element?(name)
|
88
|
+
self.class.known_elements.include?(name)
|
89
|
+
end
|
90
|
+
|
88
91
|
def append_text(string)
|
89
92
|
text_buffer.concat(string)
|
90
93
|
end
|
@@ -122,8 +125,7 @@ module Prawn
|
|
122
125
|
def style_properties
|
123
126
|
style = current_attrs['style']
|
124
127
|
if style
|
125
|
-
|
126
|
-
Hash[tokens]
|
128
|
+
style.split(';').map { |p| p.split(':', 2).map(&:strip) }.to_h
|
127
129
|
else
|
128
130
|
{}
|
129
131
|
end
|
data/lib/prawn/markup/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prawn-markup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pascal Zumkehr
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|