asciidoctor-pdf 2.1.1 → 2.1.2

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: bfcc8354e8152f540a4510dbddc39d38d577ee958aa51fbfb10b92d965abaa0c
4
- data.tar.gz: 68848a664ded97d88c45e2d8357f3880a5e10f4b6cc0f0c44b014cd85088d1ea
3
+ metadata.gz: 2109e7ec140c759820252d4c7f0f155c2d7bf4adfcad9d34fddb8cf4bc81a260
4
+ data.tar.gz: c18e3fb15231f968d907fc05693f6c4d7f9fbedfd29e368b0dc355f44d2e4254
5
5
  SHA512:
6
- metadata.gz: b1fb4074705e06fb70c188278e677c69f696e832d28d5ad49e6135b218ef36416abfaebfdedd980ff094579ae509d5006b59a52c57cf62374e9bdd69822b3714
7
- data.tar.gz: 07acff80d3d5c04e5ba8fbf591bbf3d952685bd0de605ac0e60645bbe478eafd1013451d4085abf8e2a41a996f5c4d8bba885377a1878a301ad75e144c0d2316
6
+ metadata.gz: 4e51a465c863440441cae24e429bbf84d9fb782e2c711958d5b72dfa585ba4b1b7c9c94b92d8155b2cea0d72eec276fac6e4669ea8a50c175ff8ed82ab91eb8d
7
+ data.tar.gz: a62b653261f3194d51a738cc4b1cf46f4a78a6ba0c1687fbeb06bf5049ecc9d65a20edd7acc463a2f4b473d1248795ce39902b214b87b019cbc8485d394a32f3
data/CHANGELOG.adoc CHANGED
@@ -5,6 +5,18 @@
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.1.2 (2022-06-17) - @mojavelinux
9
+
10
+ Bug Fixes::
11
+
12
+ * apply page layout from main document to new page in scratch document (#2248)
13
+ * use correct logic to insert page before TOC with automatic placement when doctype=book and media=prepress
14
+ * use `get_entries_for_toc` to determine if the TOC is non-empty rather than `Document#sections?`
15
+
16
+ === Details
17
+
18
+ {url-repo}/releases/tag/v2.1.2[git tag] | {url-repo}/compare/v2.1.1\...v2.1.2[full diff]
19
+
8
20
  == 2.1.1 (2022-06-15) - @mojavelinux
9
21
 
10
22
  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.1.1, 2022-06-15
3
+ v2.1.2, 2022-06-17
4
4
  // Settings:
5
5
  :experimental:
6
6
  :idprefix:
@@ -198,8 +198,8 @@ module Asciidoctor
198
198
 
199
199
  indent_section do
200
200
  toc_num_levels = (doc.attr 'toclevels', 2).to_i
201
- if (insert_toc = (doc.attr? 'toc') && !((toc_placement = doc.attr 'toc-placement') == 'macro' || toc_placement == 'preamble') && doc.sections?)
202
- start_toc_page doc, toc_placement if title_page_on
201
+ if (insert_toc = (doc.attr? 'toc') && !((toc_placement = doc.attr 'toc-placement') == 'macro' || toc_placement == 'preamble') && !(get_entries_for_toc doc).empty?)
202
+ start_new_page if @ppbook && verso_page?
203
203
  add_dest_for_block doc, id: 'toc', y: (at_page_top? ? page_height : nil)
204
204
  @toc_extent = allocate_toc doc, toc_num_levels, cursor, title_page_on
205
205
  else
@@ -2352,7 +2352,7 @@ module Asciidoctor
2352
2352
  # NOTE: only allow document to have a single managed toc
2353
2353
  return if @toc_extent
2354
2354
  is_macro = (placement = opts[:placement] || 'macro') == 'macro'
2355
- if ((doc = node.document).attr? 'toc-placement', placement) && (doc.attr? 'toc') && doc.sections?
2355
+ if ((doc = node.document).attr? 'toc-placement', placement) && (doc.attr? 'toc') && !(get_entries_for_toc doc).empty?
2356
2356
  start_toc_page node, placement if (is_book = doc.doctype == 'book')
2357
2357
  add_dest_for_block node, id: (node.id || 'toc') if is_macro
2358
2358
  toc_extent = @toc_extent = allocate_toc doc, (doc.attr 'toclevels', 2).to_i, cursor, (title_page_on = is_book || (doc.attr? 'title-page'))
@@ -2802,13 +2802,7 @@ module Asciidoctor
2802
2802
  value = (value.split LF).delete_if {|line| SimpleAttributeRefRx.match? line }.join LF if opts[:drop_lines_with_unresolved_attributes] && (value.include? '{')
2803
2803
  value = value.gsub '\{', '{' if escaped_attr_ref
2804
2804
  doc.set_attr 'attribute-missing', attribute_missing unless attribute_missing == 'skip'
2805
- if imagesdir
2806
- if imagesdir_to_restore
2807
- doc.set_attr 'imagesdir', imagesdir_to_restore
2808
- else
2809
- doc.remove_attr 'imagesdir'
2810
- end
2811
- end
2805
+ imagesdir_to_restore ? (doc.set_attr 'imagesdir', imagesdir_to_restore) : (doc.remove_attr 'imagesdir') if imagesdir
2812
2806
  value
2813
2807
  end
2814
2808
 
@@ -1149,7 +1149,7 @@ module Asciidoctor
1149
1149
  #
1150
1150
  # Returns an Extent or ScratchExtent object that describes the bounds of the content block.
1151
1151
  def dry_run keep_together: nil, pages_advanced: 0, single_page: nil, onto: nil, &block
1152
- (scratch_pdf = scratch).start_new_page
1152
+ (scratch_pdf = scratch).start_new_page layout: page.layout
1153
1153
  saved_bounds = scratch_pdf.bounds
1154
1154
  scratch_pdf.bounds = bounds.dup.tap do |bounds_copy|
1155
1155
  bounds_copy.instance_variable_set :@document, scratch_pdf
@@ -96,7 +96,7 @@ module Asciidoctor
96
96
  }.compact,
97
97
  }
98
98
  @theme_settings.tap do |accum|
99
- revise_roles = [].to_set
99
+ roles_with_styles = [].to_set
100
100
  theme.each_pair do |key, val|
101
101
  next unless (key = key.to_s).start_with? 'role_'
102
102
  role, key = (key.slice 5, key.length).split '_', 2
@@ -110,10 +110,10 @@ module Asciidoctor
110
110
  # (accum[role] ||= {})[:kerning] = resolved_val
111
111
  # end
112
112
  elsif key == 'font_style' || key == 'text_decoration'
113
- revise_roles << role
113
+ roles_with_styles << role
114
114
  end
115
115
  end
116
- revise_roles.each do |role|
116
+ roles_with_styles.each do |role|
117
117
  (accum[role] ||= {})[:styles] = to_styles theme[%(role_#{role}_font_style)], theme[%(role_#{role}_text_decoration)]
118
118
  end
119
119
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Asciidoctor
4
4
  module PDF
5
- VERSION = '2.1.1'
5
+ VERSION = '2.1.2'
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.1.1
4
+ version: 2.1.2
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-06-15 00:00:00.000000000 Z
12
+ date: 2022-06-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: asciidoctor