prawndown-ext 0.1.16 → 0.1.17

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: d8fa95620eebc8d3fa569c881e09daa303a05699baf9843fc651545b201bbad1
4
- data.tar.gz: ccc52e640bbd4f156b1408c89ad172e9d116d1c4b72a893e2cafedd449fbd18c
3
+ metadata.gz: 1b73e73fd9fa41b215e4fe94af0266d8ee3e9ef84aecd68d7f72cdf5a40fb48f
4
+ data.tar.gz: 2dda038ce2cecf742a7c8a9e4b7ab8eaef60a9784e70aabfc529a65d68d37103
5
5
  SHA512:
6
- metadata.gz: 62d58191700aa0e9cc2305ada47ccdeb970c9705996a0fce8f38d07e36a49bfe4d567ce0ac98d020c5038c20c18b48da338d05af3590218f05470a5a02a60989
7
- data.tar.gz: 75f66b1cc2f22eef7d9626cca4ccc2dd15cf5f2694bdd49859f29686fadbd5000c453fdbe5cf48136992d2f672c0de6c3b1c4b23bce0dfd62c7dc019ed21b80b
6
+ metadata.gz: 4a0362fc84ea6e60961b5940e3cd16c1529d2677c7eb92a7a27fcaecb97c8c4759815541c43b3a75135acbc3bc34cba2ef7b753ba731bf2562f3f08f5d1570dc
7
+ data.tar.gz: e9ab7626b05106b2656ee75b400a44bc2b55e839286fd65b09caaaed26f8828279fd5edf2d4b41822229993c4681046aa0160c4a3070755652f4adec9fe10b11
@@ -61,11 +61,11 @@ module PrawndownExt
61
61
  }
62
62
 
63
63
  def block_quote(quote)
64
- %(<command_break>{"command":"quote","margin":QUOTE_MARGIN,"text":"<font name=\'QUOTE_FONT\' character_spacing=\'QUOTE_FONT_SPACING\' size=\'QUOTE_SIZE\'>#{quote}</font>"}<command_break>)
64
+ %(<command_break>{"command":"quote","margin":QUOTE_MARGIN,"text":"<font name=\'QUOTE_FONT\' character_spacing=\'QUOTE_FONT_SPACING\' size=\'QUOTE_SIZE\'>#{quote.strip.gsub("\"","\\\"").gsub("\n","\\n")}</font>"}<command_break>)
65
65
  end
66
66
 
67
67
  def block_code(code)
68
- %(<command_break>{"command":"code","margin":CODE_MARGIN,"text":"<font name=\'CODE_FONT\' character_spacing=\'CODE_FONT_SPACING\' size=\'CODE_SIZE\'>#{code}</font>"}<command_break>)
68
+ %(<command_break>{"command":"code","margin":CODE_MARGIN,"text":"<font name=\'CODE_FONT\' character_spacing=\'CODE_FONT_SPACING\' size=\'CODE_SIZE\'>#{code.strip.gsub("\"","\\\"")}</font>"}<command_break>)
69
69
  end
70
70
 
71
71
  def block_code(code)
@@ -73,7 +73,7 @@ module PrawndownExt
73
73
  end
74
74
 
75
75
  def footnote_def(content, number)
76
- %(\n#{number}. #{content})
76
+ %(#{number}. #{content})
77
77
  end
78
78
 
79
79
  def footnote_ref(text)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module PrawndownExt
4
4
  module Ext
5
- VERSION = "0.1.16"
5
+ VERSION = "0.1.17"
6
6
  end
7
7
  end
data/lib/prawndown-ext.rb CHANGED
@@ -32,11 +32,11 @@ module PrawndownExt
32
32
  if !options.key?(args["command"] + "_line_spacing")
33
33
  options[args["command"] + "_line_spacing"] = 0
34
34
  end
35
-
35
+
36
36
  if !options.key?(args["command"] + "_horizontal_margin")
37
37
  options[args["command"] + "_horizontal_margin"] = 0
38
38
  end
39
-
39
+
40
40
  if !options.key?(args["command"] + "_vertical_margin")
41
41
  options[args["command"] + "_vertical_margin"] = 0
42
42
  end
@@ -128,7 +128,7 @@ module PrawndownExt
128
128
  def exec args, pdf, options
129
129
  if args.key?("command")
130
130
  if COMMAND.include?(args["command"])
131
-
131
+
132
132
  COMMAND[args["command"]].call(args, pdf, options)
133
133
 
134
134
  end
@@ -184,10 +184,11 @@ module PrawndownExt
184
184
  processed.each do |output|
185
185
 
186
186
  begin
187
+
187
188
  object = JSON.parse(output.strip)
188
189
 
189
190
  CommandInterface.new.exec object, self, options
190
- rescue
191
+ rescue => error
191
192
  text unescape_text(output), inline_format: true, leading: options["default_line_spacing"].to_f
192
193
  end
193
194
 
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.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - PunishedFelix