asciidoctor-pdf 2.3.2 → 2.3.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: 8eae246bb9ba9b068763fadb7bc2901bc197ab65ca6cc49b8e3c3b3d36441aa9
4
- data.tar.gz: 9411f0b4bf09f4a7ab21d24e8ab15d715fb8a5458a46efb78d342efeb9de4299
3
+ metadata.gz: 1581f65b075da9ee0793840f953f5c2562af23e5252d8c459d661bf3b59ad675
4
+ data.tar.gz: fab056a2621eed2b40f7ed3ebcfc96f3601beb2ce3634118bf9e12272874e184
5
5
  SHA512:
6
- metadata.gz: b069fca84205e6e28b4915ed973a21d246c8a3ebbe6e80cca2c3c8155633312f95f3abbfbb24f5f5a5e6c6c304e76ac7bb34e453ef754a1cfd3ee89b99315448
7
- data.tar.gz: c97b461899b43c92e350a7b00ba258b9fe216ddac4739d7a1370628c68a3dac263afb896e2827a019c8219f4962c7bf766dc62850efa64b3b07eef7470f90543
6
+ metadata.gz: d4f89a9ba025c7ca1c4563e98b6e64167ae8822c920f0f5a2e1204ea4c6cc79b1e3f5680adbc79977e9ee193435523bdc61e5be465f2dcd55f2f151c98de0680
7
+ data.tar.gz: 5cdd5a6d92cd55d70d279cd0c42cf66afe436f8f76c4facd0747964921b0f29cfa8c6012998f4e842ddcfe87a5eed4838819a98d9303aeb0717fc012b7ff0b9f
data/CHANGELOG.adoc CHANGED
@@ -5,11 +5,22 @@
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.3 (2022-10-21) - @mojavelinux
9
+
10
+ Bug Fixes::
11
+
12
+ * fix crash if last fragment in TOC entry is not rendered (#2354)
13
+ * pass `-dNEWPDF=false` to Ghostscript when optimizing PDF so it does not break internal links (#2355)
14
+
15
+ === Details
16
+
17
+ {url-repo}/releases/tag/v2.3.3[git tag] | {url-repo}/compare/v2.3.2\...v2.3.3[full diff]
18
+
8
19
  == 2.3.2 (2022-09-17) - @mojavelinux
9
20
 
10
21
  Improvements::
11
22
 
12
- * provide fallback value for `base-font-size` theme key before processing keys (#2342)
23
+ * provide fallback value for `base-font-size` theme key before processing keys (#2343)
13
24
 
14
25
  === Details
15
26
 
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.3, 2022-10-21
4
4
  // Settings:
5
5
  :experimental:
6
6
  :idprefix:
@@ -3903,12 +3903,19 @@ module Asciidoctor
3903
3903
  entry_title_fragments = text_formatter.format entry_title, inherited: entry_title_inherited
3904
3904
  line_metrics = calc_line_metrics @base_line_height
3905
3905
  indent 0, pgnum_label_placeholder_width do
3906
- (entry_title_fragments[-1][:callback] ||= []) << (last_fragment_pos = ::Asciidoctor::PDF::FormattedText::FragmentPositionRenderer.new)
3906
+ fragment_positions = []
3907
+ entry_title_fragments.each do |fragment|
3908
+ fragment_positions << (fragment_position = ::Asciidoctor::PDF::FormattedText::FragmentPositionRenderer.new)
3909
+ (fragment[:callback] ||= []) << fragment_position
3910
+ end
3907
3911
  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
3912
+ break unless (last_fragment_position = fragment_positions.select(&:page_number)[-1])
3913
+ start_dots = last_fragment_position.right + hanging_indent
3914
+ last_fragment_cursor = last_fragment_position.top + line_metrics.padding_top
3915
+ start_cursor = last_fragment_cursor if last_fragment_position.page_number > start_page_number || (start_cursor - last_fragment_cursor) > line_metrics.height
3911
3916
  end
3917
+ # NOTE: this will leave behind a gap where this entry would have been
3918
+ break unless start_dots
3912
3919
  end_cursor = cursor
3913
3920
  move_cursor_to start_cursor
3914
3921
  # NOTE: we're guaranteed to be on the same page as the final line of the entry
@@ -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.3'
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.3
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-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: asciidoctor