prawndown-ext 0.1.13 → 0.1.14

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: 1b801f60832b999e3876e1acc12b7a2067c43a5f275c512aa03833fec873aa4e
4
- data.tar.gz: 7d7fba659b4abe19cc9b379f2de8eb617d1318cd8905569fdffe3044e3a96d2d
3
+ metadata.gz: e81c1189fb2fec119b406c1f56d8fbc18470b77eab3fbe6457fa97bcea2f187d
4
+ data.tar.gz: 8334d33e581d317302353c26b15d1bd58bdf8d955acb9713584e763264de27ec
5
5
  SHA512:
6
- metadata.gz: f093e4377fbd489000b88ebde6ccd95b5ebda6ce241b3687befc479ac6d84e51764640590ff81eaae91f6d565661988c3d8b32eeb30bd4fcac7aaa097cdd9c49
7
- data.tar.gz: 1151c3d86e726b7095f8444152ea7b155f5c6421322d2a6bc1589ec04a54e8e2d0b116acdcbaebf17f9c58877aa04bce69d2cbfdbfd689810dfd0dbde9091d61
6
+ metadata.gz: 04e7eafb5f0ef9d0c0b01053a7c89a9a1a5ec899d8c8cecc8ba4a450494d0818ee7a474d17f264b84cd5c3190f2850e599143ec8d2bd4f10b28664ee1a4bfb2a
7
+ data.tar.gz: f97af900e4fc8e2b464b9c3edafa7c41bcd270d0fdf72676d584b38842cfe67acd624f1324371c21f5aacc2070e96e58a4762d60490d0219985cdc24805e12aa
@@ -2,6 +2,6 @@
2
2
 
3
3
  module PrawndownExt
4
4
  module Ext
5
- VERSION = "0.1.13"
5
+ VERSION = "0.1.14"
6
6
  end
7
7
  end
data/lib/prawndown-ext.rb CHANGED
@@ -136,30 +136,30 @@ module PrawndownExt
136
136
  end
137
137
 
138
138
  end
139
-
139
+
140
140
  def unescape_text text
141
141
  text = text.gsub('\\"', '"')
142
142
  end
143
-
144
- # Renders Markdown in the current document
145
- #
146
- # It supports header 1-6, bold text, italic text, strikethrough and links
147
- # It supports the same options as +Prawn::Document#text+
148
- #
149
- # Prawn::Document.generate('markdown.pdf') do
150
- # markdown '# Welcome to Prawndown!'
151
- # markdown '**Important:** We _hope_ you enjoy your stay!'
152
- # end
153
- def markdown(string, options: {})
154
-
143
+
144
+ # Renders Markdown in the current document
145
+ #
146
+ # It supports header 1-6, bold text, italic text, strikethrough and links
147
+ # It supports the same options as +Prawn::Document#text+
148
+ #
149
+ # Prawn::Document.generate('markdown.pdf') do
150
+ # markdown '# Welcome to Prawndown!'
151
+ # markdown '**Important:** We _hope_ you enjoy your stay!'
152
+ # end
153
+ def markdown(string, options: {})
154
+
155
155
  if !options.key?("default_line_spacing")
156
156
  options["default_line_spacing"] = 0
157
157
  end
158
158
 
159
- processed = PrawndownExt::Parser.new(string, options).to_prawn
159
+ processed = PrawndownExt::Parser.new(string, options).to_prawn
160
160
 
161
161
  processed.each do |output|
162
-
162
+
163
163
  begin
164
164
  object = JSON.parse(output.strip)
165
165
 
@@ -167,10 +167,9 @@ module PrawndownExt
167
167
  rescue
168
168
  text unescape_text(output), inline_format: true, leading: options["default_line_spacing"].to_f
169
169
  end
170
-
171
- end
172
- end
173
-
170
+
171
+ end
172
+ end
174
173
  end
175
174
  end
176
175
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prawndown-ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - PunishedFelix