kramdown-converter-pdf 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e660d7fce011739ca876132fd928632b3f194d73f2f7b8da4354eb41d0df2032
4
- data.tar.gz: 2d9ae615bc0292729860b027cae2289877bafb0d35a543866144d6d7fe47c086
3
+ metadata.gz: 795b834db4f9d6e8676470caa1f154256c59377f3fc281a268dfd37cae5915a8
4
+ data.tar.gz: 2cc6e84a09d6ad9b8c69471ab18c4f514410f202a16e14efbf54359f4a034aa1
5
5
  SHA512:
6
- metadata.gz: 2b8dd46681de42c3927e9b1eed78445ce920a798f89f96ed32345d7a005f14c9822b811a66dc6ed5a51828eaaab71f183170571f3bfca35e131088b022496c91
7
- data.tar.gz: ec537406b3db74e617ae1d55531d0669f55acf9bb84a6cef331c1a75cbf42c2bd16369dd1a7d4da12616b3e7f8d60a36a6fbe49c0aed38199b47cda47202e694
6
+ metadata.gz: 5a4dc3134d73739e56beb0aac7a6863448df1da6b8e272ca43dd1f1808fe66733d9c16550b220cbe88ffaa8b071c9ecff4503c228cefa5cef436b91d53e2ad81
7
+ data.tar.gz: 690bb84edae8de0108053b8f53f17bda2f9cb5ef83a68219d72ba2845ae97df934e7043a3ead6620a0d79b97a5026803acf64b28d18a9e3fe57d4ec96c892614
data/CONTRIBUTERS CHANGED
@@ -1,6 +1,7 @@
1
1
  Count Name
2
2
  ======= ====
3
- 11 Thomas Leitner <t_leitner@gmx.at>
3
+ 12 Thomas Leitner <t_leitner@gmx.at>
4
4
  2 Matthew Dodds <matthew.dodds@powerhrg.com>
5
5
  1 Matthew Russell Dodds <matthewrusselldodds@gmail.com>
6
+ 1 Kelly <kellyeryan@gmail.com>
6
7
  1 Carlos Palhares <chjunior@gmail.com>
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.5
1
+ 1.0.6
@@ -43,7 +43,7 @@ module Kramdown
43
43
  #
44
44
  class Pdf < Base
45
45
 
46
- VERSION = '1.0.5'
46
+ VERSION = '1.0.6'
47
47
 
48
48
  include Prawn::Measurements
49
49
 
@@ -155,7 +155,7 @@ module Kramdown
155
155
  img_dirs = @options.fetch(:image_directories, []) + ["."]
156
156
  path_or_url = img.attr["src"]
157
157
  begin
158
- image_obj, image_info = @pdf.build_image_object(open(path_or_url))
158
+ image_obj, image_info = @pdf.build_image_object(open_file(path_or_url))
159
159
  rescue StandardError
160
160
  raise if img_dirs.empty?
161
161
  path_or_url = File.join(img_dirs.shift, img.attr["src"])
@@ -445,6 +445,12 @@ module Kramdown
445
445
  alias render_raw render_footnote
446
446
  alias render_html_element render_footnote
447
447
 
448
+ def open_file(path_or_url)
449
+ URI.parse(path_or_url).open
450
+ rescue URI::InvalidURIError
451
+ open(path_or_url)
452
+ end
453
+
448
454
  # ----------------------------
449
455
  # :section: Organizational methods
450
456
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kramdown-converter-pdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Leitner
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-14 00:00:00.000000000 Z
11
+ date: 2023-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kramdown
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.2.2
55
- description:
55
+ description:
56
56
  email: t_leitner@gmx.at
57
57
  executables: []
58
58
  extensions: []
@@ -67,7 +67,7 @@ homepage: https://github.com/kramdown/converter-pdf
67
67
  licenses:
68
68
  - MIT
69
69
  metadata: {}
70
- post_install_message:
70
+ post_install_message:
71
71
  rdoc_options: []
72
72
  require_paths:
73
73
  - lib
@@ -82,8 +82,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  requirements: []
85
- rubygems_version: 3.1.2
86
- signing_key:
85
+ rubygems_version: 3.4.10
86
+ signing_key:
87
87
  specification_version: 4
88
88
  summary: kramdown-converter-pdf uses Prawn to convert a kramdown document to PDF
89
89
  test_files: []