prawndown-ext 0.1.2 → 0.1.3

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: f575daf43b174ed2094fd654fa3766991353c7a557c419ea65f1bdb08e91dcb5
4
- data.tar.gz: ff99c756b94a34d22c16a36a62e4f1eeb5ca8f3e8bd98b9d0965002f9bfe5353
3
+ metadata.gz: fd619d59e60b9e2febbd337fe13b2305e715f114595ceeef87696b8785a41ff4
4
+ data.tar.gz: 49756da2ec59eb28a26c59b858fd8e25f7ed0032c46aca28899afdd1d43a0ede
5
5
  SHA512:
6
- metadata.gz: 0abd082859ca2e9e78ef6c031301a22fc030d9779e1b7d0fd8513f6594f389fdc933e6859e0a6597598180ef7d042b03ab930a54151db4adf3a940d78c6abcf9
7
- data.tar.gz: e224eeddbb4a52086cf69853e53491d238479553b086e20fdb63c94b71133df11416f21a84591e8b6cc8dd26d3be0816f056ca2ea082f8dcf44e964dd9a025b9
6
+ metadata.gz: 7270965459f9fe64cffb85b19bcbdf4e3a0b6965c66f23c4485a52b5719f9d68e78c50f4e267b450e6037e29d5bf9be0ce93ffc4ede4ef032c0a050ce6794ae5
7
+ data.tar.gz: 85c9aecc4f40b3a3ecc88de4a484b30fd1721b8d5d9954c6c473ecb59ca22fb245ddbe51740114b6c6b39be36068264359f0a06cd869f666b1b9616a426918e8
@@ -19,7 +19,7 @@ module PrawndownExt
19
19
 
20
20
  # Images
21
21
  /!\[([^\[]+)\]\(([^\)]+)\)/ => '<command_break>{"command":"img", "alt":"\1", "path":"\2"}<command_break>',
22
- /^> (.+)/ => '<command_break>{"command":"quote","margin":100,"text":"\\1"}<command_break>', # Quote
22
+ /^> (.+)/ => '<command_break>{"command":"quote","margin":20,"text":"\\1"}<command_break>', # Quote
23
23
 
24
24
  # Stuff to process last
25
25
  /\[([^\[]+)\]\(([^\)]+)\)/ => '<link href="\2">\1</link>', # Link
@@ -2,6 +2,6 @@
2
2
 
3
3
  module PrawndownExt
4
4
  module Ext
5
- VERSION = "0.1.2"
5
+ VERSION = "0.1.3"
6
6
  end
7
7
  end
data/lib/prawndown-ext.rb CHANGED
@@ -17,18 +17,15 @@ module PrawndownExt
17
17
 
18
18
  def self.cl_text args, pdf
19
19
 
20
- pdf.text args["text"]
20
+ pdf.text args["text"], inline_format: true
21
21
 
22
22
  end
23
23
 
24
24
  def self.cl_text_box args, pdf
25
- w_size = (pdf.bounds.width - args["margin"]).to_i
26
- position = [((pdf.bounds.width - w_size) * 0.5).to_i, pdf.cursor]
27
-
28
- pdf.bounding_box(position, width: w_size) do
29
-
30
- pdf.text(args["text"])
31
-
25
+ pdf.pad args["margin"] do
26
+ pdf.indent args["margin"], args["margin"] do
27
+ pdf.text args["text"], inline_format: true
28
+ end
32
29
  end
33
30
 
34
31
  end
@@ -53,7 +50,7 @@ module PrawndownExt
53
50
  end
54
51
 
55
52
  def unescape_text text
56
- text = text.gsub('\\"', '\"')
53
+ text = text.gsub('\\"', '"')
57
54
  end
58
55
 
59
56
  # Renders Markdown in the current document
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.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - PunishedFelix