asciidoctor-pdf 2.3.1 → 2.3.3

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: 9d88e98bb4e7e4afe22f1911c28813edbfe65af757b2cfb5899c754aa811ac12
4
- data.tar.gz: 931e8ad9378ec457be0566cae2a43d5dddce06d5f821251bf842fc429b689a08
3
+ metadata.gz: 1581f65b075da9ee0793840f953f5c2562af23e5252d8c459d661bf3b59ad675
4
+ data.tar.gz: fab056a2621eed2b40f7ed3ebcfc96f3601beb2ce3634118bf9e12272874e184
5
5
  SHA512:
6
- metadata.gz: 2b530895e85531f879ad2bf1b8672281e0bc4af53cba666817d5d01349022fc0beaffe758b9def65e82db79f7e86c6bed9fcb70688e65ada7ecb993b5597f748
7
- data.tar.gz: d97b859cccfb0ff54e65f4ccae7fc4a604c3ccb33a2727d08e2a523896ec045777999397ee506959173b404d13d2b253456943ef93b390f192ed831f4418a170
6
+ metadata.gz: d4f89a9ba025c7ca1c4563e98b6e64167ae8822c920f0f5a2e1204ea4c6cc79b1e3f5680adbc79977e9ee193435523bdc61e5be465f2dcd55f2f151c98de0680
7
+ data.tar.gz: 5cdd5a6d92cd55d70d279cd0c42cf66afe436f8f76c4facd0747964921b0f29cfa8c6012998f4e842ddcfe87a5eed4838819a98d9303aeb0717fc012b7ff0b9f
data/CHANGELOG.adoc CHANGED
@@ -5,6 +5,27 @@
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
+
19
+ == 2.3.2 (2022-09-17) - @mojavelinux
20
+
21
+ Improvements::
22
+
23
+ * provide fallback value for `base-font-size` theme key before processing keys (#2343)
24
+
25
+ === Details
26
+
27
+ {url-repo}/releases/tag/v2.3.2[git tag] | {url-repo}/compare/v2.3.1\...v2.3.2[full diff]
28
+
8
29
  == 2.3.1 (2022-09-17) - @mojavelinux
9
30
 
10
31
  Improvements::
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.1, 2022-09-17
3
+ v2.3.3, 2022-10-21
4
4
  // Settings:
5
5
  :experimental:
6
6
  :idprefix:
@@ -557,7 +557,7 @@ module Asciidoctor
557
557
  def prepare_theme theme
558
558
  theme.base_border_color = nil if theme.base_border_color == 'transparent'
559
559
  theme.base_font_color ||= '000000'
560
- theme.base_font_size ||= 12
560
+ theme.base_font_family ||= 'Helvetica'
561
561
  theme.base_font_style = theme.base_font_style&.to_sym || :normal
562
562
  theme.page_numbering_start_at ||= 'body'
563
563
  theme.running_content_start_at ||= 'body'
@@ -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
@@ -78,12 +78,11 @@ module Asciidoctor
78
78
  if theme_path == BaseThemePath
79
79
  load_base_theme
80
80
  else
81
- theme_data = load_file theme_path, nil, theme_dir
81
+ theme_data = load_file theme_path, (::OpenStruct.new base_font_size: 12), theme_dir
82
82
  unless (::File.dirname theme_path) == ThemesDir
83
83
  theme_data.base_text_align ||= 'left'
84
84
  theme_data.base_line_height ||= 1
85
85
  theme_data.base_font_color ||= '000000'
86
- theme_data.base_font_size ||= 12
87
86
  theme_data.code_font_family ||= (theme_data.codespan_font_family || 'Courier')
88
87
  theme_data.conum_font_family ||= (theme_data.codespan_font_family || 'Courier')
89
88
  if (heading_font_family = theme_data.heading_font_family)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Asciidoctor
4
4
  module PDF
5
- VERSION = '2.3.1'
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.1
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