asciidoctor-pdf 2.3.2 → 2.3.4

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: 8eae246bb9ba9b068763fadb7bc2901bc197ab65ca6cc49b8e3c3b3d36441aa9
4
- data.tar.gz: 9411f0b4bf09f4a7ab21d24e8ab15d715fb8a5458a46efb78d342efeb9de4299
3
+ metadata.gz: a7fc3e4ac6264ca5d67d9c980104469ff87c54c52e869eec934a70bb938b99ca
4
+ data.tar.gz: 941b80f09b9828d4320f7e18dda3ec984885ef7cd9e6e71e7066692ce795814b
5
5
  SHA512:
6
- metadata.gz: b069fca84205e6e28b4915ed973a21d246c8a3ebbe6e80cca2c3c8155633312f95f3abbfbb24f5f5a5e6c6c304e76ac7bb34e453ef754a1cfd3ee89b99315448
7
- data.tar.gz: c97b461899b43c92e350a7b00ba258b9fe216ddac4739d7a1370628c68a3dac263afb896e2827a019c8219f4962c7bf766dc62850efa64b3b07eef7470f90543
6
+ metadata.gz: '09df883eb6acf49084ae6b504c6f7c4a51cc9d3e1aa5119c960931c44d74bf65c7838a704b4a45d07bcf2b6a3089bd52e3ae76d5f8c29fe98cb2cac05cf1fec0'
7
+ data.tar.gz: f1a1bfdb597da670a59cebf59bd4989afe5f342cc4be4c1cc76a5f8fa6704d367395e5d7684a2c8d48f57cc5116ff422237c9e672a5ab9bdb2db6da21b9d98d5
data/CHANGELOG.adoc CHANGED
@@ -5,11 +5,33 @@
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.4 (2022-10-29) - @mojavelinux
9
+
10
+ Bug Fixes::
11
+
12
+ * resolve attribute references in target of image in running content (#2361)
13
+ * replace use of AbstractNode#role= method to ensure compatiblity with minimum supported version of Asciidoctor (Asciidoctor 2.0.10) (#2363)
14
+
15
+ === Details
16
+
17
+ {url-repo}/releases/tag/v2.3.4[git tag] | {url-repo}/compare/v2.3.3\...v2.3.4[full diff]
18
+
19
+ == 2.3.3 (2022-10-21) - @mojavelinux
20
+
21
+ Bug Fixes::
22
+
23
+ * fix crash if last fragment in TOC entry is not rendered (#2354)
24
+ * pass `-dNEWPDF=false` to Ghostscript when optimizing PDF so it does not break internal links (#2355)
25
+
26
+ === Details
27
+
28
+ {url-repo}/releases/tag/v2.3.3[git tag] | {url-repo}/compare/v2.3.2\...v2.3.3[full diff]
29
+
8
30
  == 2.3.2 (2022-09-17) - @mojavelinux
9
31
 
10
32
  Improvements::
11
33
 
12
- * provide fallback value for `base-font-size` theme key before processing keys (#2342)
34
+ * provide fallback value for `base-font-size` theme key before processing keys (#2343)
13
35
 
14
36
  === Details
15
37
 
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.2, 2022-09-17
3
+ v2.3.4, 2022-10-29
4
4
  // Settings:
5
5
  :experimental:
6
6
  :idprefix:
@@ -68,7 +68,8 @@ TIP: For the latest Asciidoctor PDF features and fixes, see {url-project-docs}/w
68
68
 
69
69
  == Prerequisites
70
70
 
71
- Asciidoctor PDF is a Ruby application.
71
+ Asciidoctor PDF is built on Asciidoctor.
72
+ Like Asciidoctor, Asciidoctor PDF is a Ruby application.
72
73
  Therefore, to use it, you'll need a Ruby runtime.
73
74
 
74
75
  The supported Ruby runtimes are Ruby 2.7 or greater and JRuby 9.2 or greater.
@@ -93,6 +94,8 @@ Pass the name of the gem to the `gem install` command as follows:
93
94
 
94
95
  Installing Asciidoctor PDF will install a number of other gems mentioned in these docs, including asciidoctor, prawn, prawn-svg, prawn-table, prawn-icon, and ttfunk.
95
96
  For the most part, the versions of these dependencies are locked to the version of Asciidoctor PDF.
97
+ The patch versions are allowed to vary.
98
+ Please note that the minimum supported version of the asciidoctor gem (Asciidoctor) is 2.0.10.
96
99
 
97
100
  For further installation information about installing Asciidoctor PDF, see {url-project-docs}/install/[the installation documentation].
98
101
  For troubleshooting help, see {url-project-docs}/install/#installation-troubleshooting[Installation troubleshooting].
@@ -44,7 +44,7 @@ Gem::Specification.new do |s|
44
44
  s.add_runtime_dependency 'treetop', '~> 1.6.0'
45
45
 
46
46
  s.add_development_dependency 'rake', '~> 13.0.0'
47
- s.add_development_dependency 'rspec', '~> 3.11.0'
47
+ s.add_development_dependency 'rspec', '~> 3.12.0'
48
48
  s.add_development_dependency 'pdf-inspector', '~> 1.3.0'
49
49
  s.add_development_dependency 'chunky_png', '~> 1.4.0'
50
50
  end
@@ -765,7 +765,7 @@ module Asciidoctor
765
765
  def convert_preamble node
766
766
  # FIXME: core should not be promoting paragraph to preamble if there are no sections
767
767
  if (first_block = node.first_child)&.context == :paragraph && node.document.sections? && !first_block.role?
768
- first_block.role = 'lead'
768
+ first_block.set_attr 'role', 'lead'
769
769
  end
770
770
  traverse node
771
771
  theme_margin :block, :bottom, (next_enclosed_block node)
@@ -3435,6 +3435,7 @@ module Asciidoctor
3435
3435
  attrlist = $2
3436
3436
  image_attrs = (AttributeList.new attrlist).parse %w(alt width)
3437
3437
  image_path, image_format = ::Asciidoctor::Image.target_and_format $1, image_attrs
3438
+ image_path = apply_subs_discretely doc, image_path, subs: [:attributes], imagesdir: @themesdir
3438
3439
  if (image_path = resolve_image_path doc, image_path, image_format, @themesdir) && (::File.readable? image_path)
3439
3440
  image_opts = resolve_image_options image_path, image_format, image_attrs, container_size: [colspec_dict[side][position][:width], trim_content_height[side]]
3440
3441
  side_content[position] = [image_path, image_opts, image_attrs['link']]
@@ -3903,12 +3904,19 @@ module Asciidoctor
3903
3904
  entry_title_fragments = text_formatter.format entry_title, inherited: entry_title_inherited
3904
3905
  line_metrics = calc_line_metrics @base_line_height
3905
3906
  indent 0, pgnum_label_placeholder_width do
3906
- (entry_title_fragments[-1][:callback] ||= []) << (last_fragment_pos = ::Asciidoctor::PDF::FormattedText::FragmentPositionRenderer.new)
3907
+ fragment_positions = []
3908
+ entry_title_fragments.each do |fragment|
3909
+ fragment_positions << (fragment_position = ::Asciidoctor::PDF::FormattedText::FragmentPositionRenderer.new)
3910
+ (fragment[:callback] ||= []) << fragment_position
3911
+ end
3907
3912
  typeset_formatted_text entry_title_fragments, line_metrics, hanging_indent: hanging_indent, normalize_line_height: true
3908
- start_dots = last_fragment_pos.right + hanging_indent
3909
- last_fragment_cursor = last_fragment_pos.top + line_metrics.padding_top
3910
- start_cursor = last_fragment_cursor if last_fragment_pos.page_number > start_page_number || (start_cursor - last_fragment_cursor) > line_metrics.height
3913
+ break unless (last_fragment_position = fragment_positions.select(&:page_number)[-1])
3914
+ start_dots = last_fragment_position.right + hanging_indent
3915
+ last_fragment_cursor = last_fragment_position.top + line_metrics.padding_top
3916
+ start_cursor = last_fragment_cursor if last_fragment_position.page_number > start_page_number || (start_cursor - last_fragment_cursor) > line_metrics.height
3911
3917
  end
3918
+ # NOTE: this will leave behind a gap where this entry would have been
3919
+ break unless start_dots
3912
3920
  end_cursor = cursor
3913
3921
  move_cursor_to start_cursor
3914
3922
  # NOTE: we're guaranteed to be on the same page as the final line of the entry
@@ -13,7 +13,7 @@ class Asciidoctor::Document
13
13
  preface.id = preface.generate_id
14
14
  if (first_child = blk0.blocks[0])&.option? 'notitle'
15
15
  preface.set_option 'notitle'
16
- first_child.role = 'lead' if first_child.context == :paragraph && !first_child.role?
16
+ first_child.set_attr 'role', 'lead' if first_child.context == :paragraph && !first_child.role?
17
17
  end
18
18
  preface.blocks.replace (blk0.blocks.map do |b|
19
19
  b.parent = preface
@@ -4,6 +4,7 @@ require 'pathname'
4
4
  require 'rghost'
5
5
  require 'rghost/gs_alone'
6
6
  require 'tmpdir'
7
+ autoload :Open3, 'open3'
7
8
 
8
9
  RGhost::GSAlone.prepend (Module.new do
9
10
  def initialize params, debug
@@ -15,7 +16,11 @@ RGhost::GSAlone.prepend (Module.new do
15
16
  RGhost::Config.config_platform unless File.exist? RGhost::Config::GS[:path].to_s
16
17
  (cmd = @params.slice 1, @params.length).unshift RGhost::Config::GS[:path].to_s
17
18
  #puts cmd if @debug
18
- system(*cmd)
19
+ _out, err, status = Open3.capture3(*cmd)
20
+ unless (lines = err.lines.each_with_object([]) {|l, accum| (l.include? '-dNEWPDF=') ? accum.pop : (accum << l) }).empty?
21
+ $stderr.write(*lines)
22
+ end
23
+ status.success?
19
24
  end
20
25
  end)
21
26
 
@@ -59,7 +64,7 @@ module Asciidoctor
59
64
  else
60
65
  inputs = target
61
66
  end
62
- d = { Printed: false, CannotEmbedFontPolicy: '/Warning', CompatibilityLevel: @compatibility_level }
67
+ d = { CannotEmbedFontPolicy: '/Warning', CompatibilityLevel: @compatibility_level, NEWPDF: false, Printed: false }
63
68
  case @compliance
64
69
  when 'PDF/A', 'PDF/A-1', 'PDF/A-2', 'PDF/A-3'
65
70
  d[:PDFA] = ((@compliance.split '-', 2)[1] || 1).to_i
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Asciidoctor
4
4
  module PDF
5
- VERSION = '2.3.2'
5
+ VERSION = '2.3.4'
6
6
  end
7
7
  end
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.2
4
+ version: 2.3.4
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: 2022-09-17 00:00:00.000000000 Z
12
+ date: 2022-10-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: asciidoctor
@@ -157,14 +157,14 @@ dependencies:
157
157
  requirements:
158
158
  - - "~>"
159
159
  - !ruby/object:Gem::Version
160
- version: 3.11.0
160
+ version: 3.12.0
161
161
  type: :development
162
162
  prerelease: false
163
163
  version_requirements: !ruby/object:Gem::Requirement
164
164
  requirements:
165
165
  - - "~>"
166
166
  - !ruby/object:Gem::Version
167
- version: 3.11.0
167
+ version: 3.12.0
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: pdf-inspector
170
170
  requirement: !ruby/object:Gem::Requirement