asciidoctor-pdf 2.3.12 → 2.3.13

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: f6d4fcd7f484c87480980add66936d91a6fd83a96509a1a0bf54edbd297827d9
4
- data.tar.gz: f87f24fe33309886cdad555f0a31981a6c23d50192611ee954fe25c722031bd7
3
+ metadata.gz: 6c9cfc31dfbf69e0d550a21fcb6cfa92f8e8310ea03f7e45e058af969b6e671b
4
+ data.tar.gz: d994b9f9e4b7cceaedabc388e868806f3769a8dbcfa0ba043d1061a7e0cdb939
5
5
  SHA512:
6
- metadata.gz: c8496b8e15d1a3ea1c65da73e3a1233a71475fa972e384559a74a06e6b92d8454367dece149793719f915d687a1382160b75c38e86e21c62fc833f4bc1e6214b
7
- data.tar.gz: 6c74e398c951bfc82637cfb8fe701f0c38849841a327016f987795451db0541c76d1a68a84c08a443d3142f8012f5b313feb6bd9993c3910929848a39a289fa4
6
+ metadata.gz: ecf1efe60ea4baa8935f7fb952c70303d8beda90d6d28684c7492fa0135dc71961699f82fbca808a12e16a29e975f645fd4e4a2ae84579ee4966fdba5a89f558
7
+ data.tar.gz: 2ebd69f420f484b423853519e034c54c36070b37a70accf3cf8ef83406db66c7f96bb0c8f8e0f141a67a8059a8cbdba88253dde6c75468c94864d37df3fa11c2
data/CHANGELOG.adoc CHANGED
@@ -5,6 +5,20 @@
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.13 (2024-02-16) - @mojavelinux
9
+
10
+ Bug Fixes::
11
+
12
+ * don't drop text on line above inline image macro in running content value (#2495)
13
+ * when looking for a value that only contains an image macro, match the whole string instead of per line (#2495)
14
+ * 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
+ * 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
+
18
+ === Details
19
+
20
+ {url-repo}/releases/tag/v2.3.13[git tag] | {url-repo}/compare/v2.3.12\...v2.3.13[full diff]
21
+
8
22
  == 2.3.12 (2024-02-02) - @mojavelinux
9
23
 
10
24
  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.12, 2024-02-02
3
+ v2.3.13, 2024-02-16
4
4
  // Settings:
5
5
  :experimental:
6
6
  :idprefix:
@@ -109,7 +109,7 @@ module Asciidoctor
109
109
  MeasurementPartsRx = /^(\d+(?:\.\d+)?)(in|mm|cm|p[txc])?$/
110
110
  PageSizeRx = /^(?:\[(#{MeasurementRxt}), ?(#{MeasurementRxt})\]|(#{MeasurementRxt})(?: x |x)(#{MeasurementRxt})|\S+)$/
111
111
  CalloutExtractRx = %r((?:(?://|#|--|;;) ?)?(\\)?<!?(|--)(\d+|\.)\2> ?(?=(?:\\?<!?\2(?:\d+|\.)\2> ?)*$))
112
- ImageAttributeValueRx = /^image:{1,2}(.*?)\[(.*?)\]$/
112
+ ImageAttributeValueRx = /^\Aimage:{1,2}(.*?)\[(.*?)\]$\Z/
113
113
  StopPunctRx = /[.!?;:]$/
114
114
  UriBreakCharsRx = %r((?:/|\?|&amp;|#)(?!$))
115
115
  UriBreakCharRepl = %(\\&#{ZeroWidthSpace})
@@ -174,7 +174,7 @@ module Asciidoctor
174
174
  ink_cover_page doc, :front
175
175
  has_front_cover = page_number > marked_page_number
176
176
  doctype = doc.doctype
177
- if (has_title_page = (title_page_on = doctype == 'book' || (doc.attr? 'title-page')) && (start_title_page doc))
177
+ if (has_title_page = (title_as_page = doctype == 'book' || (doc.attr? 'title-page')) && (start_title_page doc))
178
178
  # NOTE: the base font must be set before any content is written to the main or scratch document
179
179
  font @theme.base_font_family, size: @root_font_size, style: @theme.base_font_style
180
180
  if perform_on_single_page { ink_title_page doc }
@@ -189,7 +189,7 @@ module Asciidoctor
189
189
  font @theme.base_font_family, size: @root_font_size, style: @theme.base_font_style
190
190
  end
191
191
 
192
- unless title_page_on
192
+ unless title_as_page
193
193
  body_start_page_number = page_number
194
194
  theme_font :heading, level: 1 do
195
195
  ink_general_heading doc, doc.doctitle, align: (@theme.heading_h1_text_align&.to_sym || :center), level: 1, role: :doctitle
@@ -200,10 +200,10 @@ module Asciidoctor
200
200
 
201
201
  indent_section do
202
202
  toc_num_levels = (doc.attr 'toclevels', 2).to_i
203
- if (insert_toc = (doc.attr? 'toc') && !((toc_placement = doc.attr 'toc-placement') == 'macro' || toc_placement == 'preamble') && !(get_entries_for_toc doc).empty?)
203
+ if (toc_at_top = (doc.attr? 'toc') && !((toc_placement = doc.attr 'toc-placement') == 'macro' || toc_placement == 'preamble') && !(get_entries_for_toc doc).empty?)
204
204
  start_new_page if @ppbook && verso_page?
205
205
  add_dest_for_block doc, id: 'toc', y: (at_page_top? ? page_height : nil)
206
- @toc_extent = allocate_toc doc, toc_num_levels, cursor, (title_page_on && theme.toc_break_after != 'auto')
206
+ @toc_extent = allocate_toc doc, toc_num_levels, cursor, (title_as_page && theme.toc_break_after != 'auto')
207
207
  else
208
208
  @toc_extent = nil
209
209
  end
@@ -215,7 +215,7 @@ module Asciidoctor
215
215
  min_start_at = 1
216
216
  end
217
217
 
218
- if title_page_on
218
+ if title_as_page
219
219
  zero_page_offset = has_front_cover ? 1 : 0
220
220
  first_page_offset = has_title_page ? zero_page_offset.next : zero_page_offset
221
221
  body_offset = (body_start_page_number = page_number) - 1
@@ -228,8 +228,10 @@ module Asciidoctor
228
228
  when 'title'
229
229
  running_content_start_at = 'toc' unless has_title_page
230
230
  when 'toc'
231
- running_content_start_at = 'body' unless insert_toc
231
+ uses_start_at_toc = true
232
+ running_content_start_at = 'body' unless toc_at_top
232
233
  when 'after-toc'
234
+ uses_start_at_after_toc = true
233
235
  running_content_start_at = 'body'
234
236
  end
235
237
  end
@@ -248,8 +250,10 @@ module Asciidoctor
248
250
  when 'title'
249
251
  page_numbering_start_at = 'toc' unless has_title_page
250
252
  when 'toc'
251
- page_numbering_start_at = 'body' unless insert_toc
253
+ uses_start_at_toc = true
254
+ page_numbering_start_at = 'body' unless toc_at_top
252
255
  when 'after-toc'
256
+ uses_start_at_after_toc = true
253
257
  page_numbering_start_at = 'body'
254
258
  end
255
259
  end
@@ -303,12 +307,17 @@ module Asciidoctor
303
307
  end
304
308
 
305
309
  if (toc_extent = @toc_extent)
306
- if title_page_on && !insert_toc
307
- if @theme.running_content_start_at == 'after-toc' || @theme.page_numbering_start_at == 'after-toc' # rubocop:disable Style/SoleNestedConditional
308
- last_toc_page = toc_extent.to.page
309
- last_toc_page += 1 if @ppbook && (recto_page? last_toc_page)
310
- num_front_matter_pages[0] = last_toc_page if @theme.running_content_start_at == 'after-toc'
311
- num_front_matter_pages[1] = last_toc_page if @theme.page_numbering_start_at == 'after-toc'
310
+ if title_as_page && !toc_at_top && (uses_start_at_toc || uses_start_at_after_toc)
311
+ if uses_start_at_toc
312
+ toc_offset = toc_extent.from.page - 1
313
+ num_front_matter_pages[0] = toc_offset if @theme.running_content_start_at == 'toc'
314
+ num_front_matter_pages[1] = toc_offset if @theme.page_numbering_start_at == 'toc'
315
+ end
316
+ if uses_start_at_after_toc
317
+ after_toc_offset = toc_extent.to.page
318
+ after_toc_offset += 1 if @ppbook && (recto_page? after_toc_offset)
319
+ num_front_matter_pages[0] = after_toc_offset if @theme.running_content_start_at == 'after-toc'
320
+ num_front_matter_pages[1] = after_toc_offset if @theme.page_numbering_start_at == 'after-toc'
312
321
  end
313
322
  end
314
323
  toc_page_nums = ink_toc doc, toc_num_levels, toc_extent.from.page, toc_extent.from.cursor, num_front_matter_pages[1]
@@ -2368,8 +2377,16 @@ module Asciidoctor
2368
2377
  if ((doc = node.document).attr? 'toc-placement', placement) && (doc.attr? 'toc') && !(get_entries_for_toc doc).empty?
2369
2378
  start_toc_page node, placement if (is_book = doc.doctype == 'book')
2370
2379
  add_dest_for_block node, id: (node.id || 'toc') if is_macro
2371
- toc_extent = @toc_extent = allocate_toc doc, (doc.attr 'toclevels', 2).to_i, cursor, (title_page_on = is_book || (doc.attr? 'title-page'))
2372
- @index.start_page_number = toc_extent.to.page + 1 if title_page_on && @theme.page_numbering_start_at == 'after-toc'
2380
+ toc_extent = @toc_extent = allocate_toc doc, (doc.attr 'toclevels', 2).to_i, cursor, (title_as_page = is_book || (doc.attr? 'title-page'))
2381
+ if title_as_page
2382
+ if @theme.page_numbering_start_at == 'toc'
2383
+ @index.start_page_number = toc_extent.from.page
2384
+ elsif @theme.page_numbering_start_at == 'after-toc'
2385
+ new_start_page_number = toc_extent.to.page + 1
2386
+ new_start_page_number += 1 if @ppbook && (verso_page? new_start_page_number)
2387
+ @index.start_page_number = new_start_page_number
2388
+ end
2389
+ end
2373
2390
  if is_macro
2374
2391
  @disable_running_content[:header] += toc_extent.page_range if node.option? 'noheader'
2375
2392
  @disable_running_content[:footer] += toc_extent.page_range if node.option? 'nofooter'
@@ -33,7 +33,9 @@ Prawn::Text::Formatted::Box.prepend (Module.new do
33
33
  end
34
34
 
35
35
  # help Prawn correctly resolve which font to analyze, including the font style
36
+ # also instruct Prawn to ignore fragment for inline image since the text is just a placeholder
36
37
  def analyze_glyphs_for_fallback_font_support fragment_hash
38
+ return [fragment_hash] if fragment_hash[:image_obj]
37
39
  fragment_font = fragment_hash[:font] || (original_font = @document.font.family)
38
40
  effective_font_styles = @document.font_styles
39
41
  fragment_font_opts = {}
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Asciidoctor
4
4
  module PDF
5
- VERSION = '2.3.12'
5
+ VERSION = '2.3.13'
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.12
4
+ version: 2.3.13
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-02-02 00:00:00.000000000 Z
12
+ date: 2024-02-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: asciidoctor