asciidoctor-pdf 2.3.13 → 2.3.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 +4 -4
- data/CHANGELOG.adoc +24 -1
- data/README.adoc +1 -1
- data/asciidoctor-pdf.gemspec +1 -1
- data/lib/asciidoctor/pdf/converter.rb +8 -8
- data/lib/asciidoctor/pdf/ext/asciidoctor/image.rb +3 -2
- data/lib/asciidoctor/pdf/ext/prawn-svg/elements/use.rb +12 -0
- data/lib/asciidoctor/pdf/ext/prawn-svg.rb +1 -0
- data/lib/asciidoctor/pdf/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39b6ad360fe1b653c7f0498edad3e45c8f76549e035f9dcdab76f088df362cbd
|
4
|
+
data.tar.gz: 81a541dc83a1aa325c3586fae64947e68128387634810512be01898b2096f684
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6fd8480e6c642612fe12656aef7208afee65fa6a126b56aa366d11dc11078271fc1744cb92d3849131f3c0948d5ccff6c4a1041a779b4244ebc9fbd768d26b8
|
7
|
+
data.tar.gz: 17378df2c24a571bb63334b4b2fe030f00ad9010dcbfeadef0fd4b626551984897841af0916228eac5bd11ff44f134ea9e6abf46cdf6a4a9a570995eca11bdeb
|
data/CHANGELOG.adoc
CHANGED
@@ -5,14 +5,37 @@
|
|
5
5
|
This document provides a high-level view of the changes to the {project-name} by release.
|
6
6
|
For a detailed view of what has changed, refer to the {url-repo}/commits/main[commit history] on GitHub.
|
7
7
|
|
8
|
+
== 2.3.14 (2024-03-08) - @mojavelinux
|
9
|
+
|
10
|
+
Improvements::
|
11
|
+
|
12
|
+
* upgrade prawn-svg to 0.34 to add support for SVG referenced by image tag (SVG in SVG)
|
13
|
+
|
14
|
+
Bug Fixes::
|
15
|
+
|
16
|
+
* propagate source location to table cell for description in horizontal dlist so it is included in truncation warning message (#2502)
|
17
|
+
* eradicate use of the base64 library to fix warning about base64 gem when using Ruby >= 3.3
|
18
|
+
* upgrade prawn-svg to 0.34 to fix warning about base64 gem when using Ruby >= 3.3; apply additional patch to fix bug in prawn-svg
|
19
|
+
|
20
|
+
Build / Infrastructure::
|
21
|
+
|
22
|
+
* bump upper Ruby version to 3.3 in CI workflow
|
23
|
+
|
24
|
+
=== Details
|
25
|
+
|
26
|
+
{url-repo}/releases/tag/v2.3.14[git tag] | {url-repo}/compare/v2.3.13\...v2.3.14[full diff]
|
27
|
+
|
8
28
|
== 2.3.13 (2024-02-16) - @mojavelinux
|
9
29
|
|
30
|
+
Improvements::
|
31
|
+
|
32
|
+
* support toc start at value for page numbering and running content when toc is added using macro (#2489)
|
33
|
+
|
10
34
|
Bug Fixes::
|
11
35
|
|
12
36
|
* don't drop text on line above inline image macro in running content value (#2495)
|
13
37
|
* when looking for a value that only contains an image macro, match the whole string instead of per line (#2495)
|
14
38
|
* don't warn about missing character in fallback font when inline image is advanced to next page (#2492)
|
15
|
-
* support toc start at value for page numbering and running content when toc is added using macro (#2489)
|
16
39
|
* fix page number of index entries in prepress book when page numbering starts at toc or after toc and toc is inserted using macro (#2487)
|
17
40
|
|
18
41
|
=== Details
|
data/README.adoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= Asciidoctor PDF: A native PDF converter for AsciiDoc
|
2
2
|
Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
|
3
|
-
v2.3.
|
3
|
+
v2.3.14, 2024-03-08
|
4
4
|
// Settings:
|
5
5
|
:experimental:
|
6
6
|
:idprefix:
|
data/asciidoctor-pdf.gemspec
CHANGED
@@ -38,7 +38,7 @@ Gem::Specification.new do |s|
|
|
38
38
|
s.add_runtime_dependency 'matrix', '~> 0.4' # required until prawn >= 2.5.0 is released
|
39
39
|
s.add_runtime_dependency 'prawn-table', '~> 0.2.0'
|
40
40
|
s.add_runtime_dependency 'prawn-templates', '~> 0.1.0'
|
41
|
-
s.add_runtime_dependency 'prawn-svg', '~> 0.
|
41
|
+
s.add_runtime_dependency 'prawn-svg', '~> 0.34.0'
|
42
42
|
s.add_runtime_dependency 'prawn-icon', '~> 3.0.0'
|
43
43
|
s.add_runtime_dependency 'concurrent-ruby', '~> 1.1'
|
44
44
|
s.add_runtime_dependency 'treetop', '~> 1.6.0'
|
@@ -1458,7 +1458,7 @@ module Asciidoctor
|
|
1458
1458
|
desc_container = Block.new node, :open
|
1459
1459
|
desc_container << (Block.new desc_container, :paragraph, source: (desc.instance_variable_get :@text), subs: :default) if desc.text?
|
1460
1460
|
desc.blocks.each {|b| desc_container << b.dup } if desc.blocks?
|
1461
|
-
row_data << { content: (::Prawn::Table::Cell::AsciiDoc.new self, content: (item[1] = desc_container), text_color: @font_color, padding: desc_padding, valign: :top) }
|
1461
|
+
row_data << { content: (::Prawn::Table::Cell::AsciiDoc.new self, content: (item[1] = desc_container), text_color: @font_color, padding: desc_padding, valign: :top, source_location: desc.source_location) }
|
1462
1462
|
else
|
1463
1463
|
row_data << {}
|
1464
1464
|
end
|
@@ -1721,7 +1721,7 @@ module Asciidoctor
|
|
1721
1721
|
if image_format == 'gif' && !(defined? ::GMagick::Image)
|
1722
1722
|
log :warn, %(GIF image format not supported. Install the prawn-gmagick gem or convert #{target} to PNG.)
|
1723
1723
|
image_path = nil
|
1724
|
-
elsif ::
|
1724
|
+
elsif ::Asciidoctor::Image::Base64Encoded === target
|
1725
1725
|
image_path = target
|
1726
1726
|
elsif (image_path = resolve_image_path node, target, image_format, (opts.fetch :relative_to_imagesdir, true))
|
1727
1727
|
if image_format == 'pdf'
|
@@ -1790,8 +1790,8 @@ module Asciidoctor
|
|
1790
1790
|
rendered_h = rendered_w = nil
|
1791
1791
|
span_page_width_if align_to_page do
|
1792
1792
|
if image_format == 'svg'
|
1793
|
-
if ::
|
1794
|
-
svg_data =
|
1793
|
+
if ::Asciidoctor::Image::Base64Encoded === image_path
|
1794
|
+
svg_data = image_path.unpack1 'm'
|
1795
1795
|
file_request_root = false
|
1796
1796
|
else
|
1797
1797
|
svg_data = ::File.read image_path, mode: 'r:UTF-8'
|
@@ -1842,8 +1842,8 @@ module Asciidoctor
|
|
1842
1842
|
else
|
1843
1843
|
# FIXME: this code really needs to be better organized!
|
1844
1844
|
# NOTE: use low-level API to access intrinsic dimensions; build_image_object caches image data previously loaded
|
1845
|
-
image_obj, image_info = ::
|
1846
|
-
::StringIO.open((
|
1845
|
+
image_obj, image_info = ::Asciidoctor::Image::Base64Encoded === image_path ?
|
1846
|
+
::StringIO.open((image_path.unpack1 'm'), 'rb') {|fd| build_image_object fd } :
|
1847
1847
|
::File.open(image_path, 'rb') {|fd| build_image_object fd }
|
1848
1848
|
actual_w = to_pt image_info.width, :px
|
1849
1849
|
width = actual_w * scale if scale
|
@@ -4313,11 +4313,11 @@ module Asciidoctor
|
|
4313
4313
|
end
|
4314
4314
|
@tmp_files ||= {}
|
4315
4315
|
# NOTE: base64 logic currently used for inline images
|
4316
|
-
if ::
|
4316
|
+
if ::Asciidoctor::Image::Base64Encoded === image_path
|
4317
4317
|
return @tmp_files[image_path] if @tmp_files.key? image_path
|
4318
4318
|
tmp_image = ::Tempfile.create %W(image- .#{image_format})
|
4319
4319
|
tmp_image.binmode unless image_format == 'svg'
|
4320
|
-
tmp_image.write
|
4320
|
+
tmp_image.write image_path.unpack1 'm'
|
4321
4321
|
tmp_image.close
|
4322
4322
|
@tmp_files[image_path] = tmp_image.path
|
4323
4323
|
# NOTE: this will catch a classloader resource path on JRuby (e.g., uri:classloader:/path/to/image)
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
module Asciidoctor
|
4
4
|
module Image
|
5
|
+
Base64Encoded = ::Module.new
|
5
6
|
DataUriRx = %r(^data:image/(?<fmt>png|jpe?g|gif|pdf|bmp|tiff|svg\+xml);base64,(?<data>.*)$)
|
6
7
|
FormatAliases = { 'jpg' => 'jpeg', 'svg+xml' => 'svg' }
|
7
8
|
|
@@ -11,7 +12,7 @@ module Asciidoctor
|
|
11
12
|
|
12
13
|
def self.target_and_format image_path, attributes = nil
|
13
14
|
if (image_path.start_with? 'data:') && (m = DataUriRx.match image_path)
|
14
|
-
[(m[:data].extend
|
15
|
+
[(m[:data].extend Base64Encoded), (FormatAliases.fetch m[:fmt], m[:fmt])]
|
15
16
|
else
|
16
17
|
[image_path, attributes&.[]('format') || ((ext = ::File.extname image_path).downcase.slice 1, ext.length)]
|
17
18
|
end
|
@@ -20,7 +21,7 @@ module Asciidoctor
|
|
20
21
|
def target_and_format
|
21
22
|
image_path = inline? ? target : (attr 'target')
|
22
23
|
if (image_path.start_with? 'data:') && (m = DataUriRx.match image_path)
|
23
|
-
[(m[:data].extend
|
24
|
+
[(m[:data].extend Base64Encoded), (FormatAliases.fetch m[:fmt], m[:fmt])]
|
24
25
|
else
|
25
26
|
[image_path, (attr 'format', nil, false) || ((ext = ::File.extname image_path).downcase.slice 1, ext.length)]
|
26
27
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# see https://github.com/mogest/prawn-svg/issues/164
|
4
|
+
Prawn::SVG::Elements::Use.prepend (Module.new do
|
5
|
+
def parse
|
6
|
+
result = super
|
7
|
+
if @referenced_element_source.name == 'symbol' && !(@referenced_element_source.attributes.key? 'viewBox')
|
8
|
+
@referenced_element_class = Prawn::SVG::Elements::Container
|
9
|
+
end
|
10
|
+
result
|
11
|
+
end
|
12
|
+
end)
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require 'prawn-svg'
|
4
4
|
require_relative 'prawn-svg/calculators/document_sizing'
|
5
5
|
require_relative 'prawn-svg/elements/image'
|
6
|
+
require_relative 'prawn-svg/elements/use'
|
6
7
|
require_relative 'prawn-svg/loaders/data'
|
7
8
|
require_relative 'prawn-svg/loaders/file'
|
8
9
|
require_relative 'prawn-svg/loaders/web'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-pdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Allen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-03-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: asciidoctor
|
@@ -87,14 +87,14 @@ dependencies:
|
|
87
87
|
requirements:
|
88
88
|
- - "~>"
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: 0.
|
90
|
+
version: 0.34.0
|
91
91
|
type: :runtime
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
95
|
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: 0.
|
97
|
+
version: 0.34.0
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: prawn-icon
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
@@ -262,6 +262,7 @@ files:
|
|
262
262
|
- lib/asciidoctor/pdf/ext/prawn-svg.rb
|
263
263
|
- lib/asciidoctor/pdf/ext/prawn-svg/calculators/document_sizing.rb
|
264
264
|
- lib/asciidoctor/pdf/ext/prawn-svg/elements/image.rb
|
265
|
+
- lib/asciidoctor/pdf/ext/prawn-svg/elements/use.rb
|
265
266
|
- lib/asciidoctor/pdf/ext/prawn-svg/loaders/data.rb
|
266
267
|
- lib/asciidoctor/pdf/ext/prawn-svg/loaders/file.rb
|
267
268
|
- lib/asciidoctor/pdf/ext/prawn-svg/loaders/web.rb
|
@@ -335,7 +336,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
335
336
|
- !ruby/object:Gem::Version
|
336
337
|
version: '0'
|
337
338
|
requirements: []
|
338
|
-
rubygems_version: 3.3
|
339
|
+
rubygems_version: 3.5.3
|
339
340
|
signing_key:
|
340
341
|
specification_version: 4
|
341
342
|
summary: Converts AsciiDoc documents to PDF using Asciidoctor and Prawn
|