asciidoctor-pdf 2.3.27 → 2.3.28

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: 9139f7e33e3e3315511b4a776645a86dde196465473673bbf4cd5472556e3e11
4
- data.tar.gz: '0518d599bd4c839384cf4bb3e6817791abb90998b1e6124092eeb6e8e31e5a30'
3
+ metadata.gz: '09ece6bf334a904f625c4b023c72e243e5b88a0a7ab1d2ae5d4bea42fd676371'
4
+ data.tar.gz: b2b8078cba29466b8cec473208ce07c225148386c7d59d5903e463a04f362e1e
5
5
  SHA512:
6
- metadata.gz: 2a729565ce0dbba9df85c3803c67dca6a59f653faa3d482af16f5c1ccd7b0e7869d2c79169a5799fd57bae41dbc7f9f32296c347cfe5b86808370b1f9cf12c9a
7
- data.tar.gz: 30c6c70a8fd29aaa202ab648bcd1ea21b2b67bc0ee50e6091dde4d833cfcbb22f9846af3f7bc7fc841f4b9548e9f79ca30f85118b5fa4852dcece1ffbb3b9f2f
6
+ metadata.gz: 42483e2c20fd4ce68ef52cd8d0837b6a41c71306ef3f365c48bd32428e4bfb8641d2c7bc605da8666602a9b4ce2dc7566decf74037e2f5197021214102d204a3
7
+ data.tar.gz: f687499f7c8d29b374fe5e6d3ccf7cb2776ffbf26684c31c3ff6feb175e8b10d87592ab233c093e940373bb0acb9efe0ccbdb6f88817e8dc2046981802e52d5f
data/CHANGELOG.adoc CHANGED
@@ -5,6 +5,24 @@
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.28 (2026-11-20) - @mojavelinux
9
+
10
+ Improvements::
11
+
12
+ * explicitly turn off web requests when computing image dimensions of SVG
13
+ * set enable_web_requests option on SVG interface when using image helper method
14
+
15
+ Bug Fixes::
16
+
17
+ * fall back to conum ordinal in braces if conum glpyh cannot be resolved (#2662)
18
+ * fix crash when icon-based font is used in section title (#2668)
19
+ * don't include duplicate see also terms in index
20
+ * restore the transformation stack when rendering SVG images; fixes interactions between SVGs with gradients (#2671)
21
+
22
+ === Details
23
+
24
+ {url-repo}/releases/tag/v2.3.28[git tag] | {url-repo}/compare/v2.3.27\...v2.3.28[full diff]
25
+
8
26
  == 2.3.27 (2026-09-02) - @mojavelinux
9
27
 
10
28
  Bug Fixes::
@@ -417,6 +435,7 @@ Enhancements::
417
435
  * use default-for-print theme by default if media is `print` or `prepress` (#2306)
418
436
  * support text alignment roles on all styled paragraphs
419
437
  * support text alignment roles on verse block
438
+ * prevent a line break in front of formatted text with `wj` role when preceded by a non-space character (#2297)
420
439
 
421
440
  Bug Fixes::
422
441
 
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.27, 2026-09-02
3
+ v2.3.28, 2026-11-20
4
4
  // Settings:
5
5
  :experimental:
6
6
  :idprefix:
@@ -1942,7 +1942,7 @@ module Asciidoctor
1942
1942
  def convert_audio node
1943
1943
  add_dest_for_block node if node.id
1944
1944
  audio_path = node.media_uri node.attr 'target'
1945
- play_symbol = (node.document.attr? 'icons', 'font') ? %(<font name="fas">#{(icon_font_data 'fas').unicode 'play'}</font>) : RightPointer
1945
+ play_symbol = (node.document.attr? 'icons', 'font') ? %(<font name="fas">#{icon_font_glyph 'fas', 'play'}</font>) : RightPointer
1946
1946
  ink_prose %(#{play_symbol}#{NoBreakSpace}<a href="#{audio_path}">#{audio_path}</a> <em>(audio)</em>), normalize: false, margin: 0
1947
1947
  ink_caption node, labeled: false, end: :bottom if node.title?
1948
1948
  theme_margin :block, :bottom, (next_enclosed_block node)
@@ -1970,7 +1970,7 @@ module Asciidoctor
1970
1970
 
1971
1971
  if poster.nil_or_empty?
1972
1972
  add_dest_for_block node if node.id
1973
- play_symbol = (node.document.attr? 'icons', 'font') ? %(<font name="fas">#{(icon_font_data 'fas').unicode 'play'}</font>) : RightPointer
1973
+ play_symbol = (node.document.attr? 'icons', 'font') ? %(<font name="fas">#{icon_font_glyph 'fas', 'play'}</font>) : RightPointer
1974
1974
  ink_prose %(#{play_symbol}#{NoBreakSpace}<a href="#{video_path}">#{video_path}</a> <em>(#{type})</em>), normalize: false, margin: 0
1975
1975
  ink_caption node, labeled: false, end: :bottom if node.title?
1976
1976
  theme_margin :block, :bottom, (next_enclosed_block node)
@@ -2599,23 +2599,22 @@ module Asciidoctor
2599
2599
  if (remapped_icon_name = resolve_legacy_icon_name icon_name)
2600
2600
  requested_icon_name = icon_name
2601
2601
  icon_set, icon_name = remapped_icon_name.split '-', 2
2602
- glyph = (icon_font_data icon_set).unicode icon_name
2602
+ glyph = icon_font_glyph icon_set, icon_name
2603
2603
  log(:info) { %(#{requested_icon_name} icon found in deprecated fa icon set; using #{icon_name} from #{icon_set} icon set instead) }
2604
2604
  # new name in Font Awesome >= 5 (but document is configured to use fa icon set)
2605
2605
  else
2606
- font_data = nil
2607
- if (resolved_icon_set = FontAwesomeIconSets.find {|candidate| (font_data = icon_font_data candidate).unicode icon_name rescue nil })
2606
+ glyph = nil
2607
+ if (resolved_icon_set = FontAwesomeIconSets.find {|candidate| glyph = icon_font_glyph candidate, icon_name })
2608
2608
  icon_set = resolved_icon_set
2609
- glyph = font_data.unicode icon_name
2610
2609
  log(:info) { %(#{icon_name} icon not found in deprecated fa icon set; using match found in #{resolved_icon_set} icon set instead) }
2611
2610
  end
2612
2611
  end
2613
2612
  else
2614
- glyph = (icon_font_data icon_set).unicode icon_name rescue nil
2613
+ glyph = icon_font_glyph icon_set, icon_name
2615
2614
  end
2616
2615
  unless glyph || explicit_icon_set || !icon_name.start_with?(*IconSetPrefixes)
2617
2616
  icon_set, icon_name = icon_name.split '-', 2
2618
- glyph = (icon_font_data icon_set).unicode icon_name rescue nil
2617
+ glyph = icon_font_glyph icon_set, icon_name
2619
2618
  end
2620
2619
  if glyph
2621
2620
  if node.attr? 'size'
@@ -4077,7 +4076,7 @@ module Asciidoctor
4077
4076
  def intrinsic_image_dimensions path, format
4078
4077
  if format == 'svg'
4079
4078
  # NOTE: prawn-svg automatically converts intrinsic width and height to pt
4080
- img_obj = ::Prawn::SVG::Interface.new (::File.read path, mode: 'r:UTF-8'), self, {}
4079
+ img_obj = ::Prawn::SVG::Interface.new (::File.read path, mode: 'r:UTF-8'), self, enable_web_requests: false
4081
4080
  img_size = img_obj.document.sizing
4082
4081
  { width: img_size.output_width, height: img_size.output_height }
4083
4082
  else
@@ -4943,7 +4942,7 @@ module Asciidoctor
4943
4942
  end
4944
4943
 
4945
4944
  def conum_glyph number
4946
- @conum_glyphs[number - 1]
4945
+ @conum_glyphs[number - 1] || %((#{number}))
4947
4946
  end
4948
4947
 
4949
4948
  # Derive a PDF-safe, ASCII-only anchor name from the given value.
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ # TODO: remove after upgrading to Prawn 2.5.0
4
+ # NOTE: for some reason, using Module.prepend doesn't work in this case on Ruby 2.7
5
+ module Prawn::Document::Internals
6
+ def save_graphics_state state = nil, &block
7
+ save_transformation_stack
8
+ renderer.save_graphics_state state, &block
9
+ restore_transformation_stack if block_given?
10
+ end
11
+ end
@@ -394,6 +394,19 @@ module Asciidoctor
394
394
  FontStyleToSet[style].dup
395
395
  end
396
396
 
397
+ def icon_font_data family
398
+ ::Prawn::Icon::FontData.load self, family
399
+ end
400
+
401
+ def icon_font_glyph family, key
402
+ (icon_font_data family).unicode key
403
+ rescue ::Prawn::Icon::Errors::IconNotFound # rubocop:disable Lint/SuppressedException
404
+ end
405
+
406
+ def resolve_legacy_icon_name name
407
+ ::Prawn::Icon::Legacy.mapping[%(fa-#{name})]
408
+ end
409
+
397
410
  # Override width of string to check for placeholder char, which uses character spacing to control width
398
411
  #
399
412
  def width_of_string string, options
@@ -8,10 +8,7 @@ module Asciidoctor
8
8
  # FIXME: handle case when SVG is an IO object
9
9
  if ::String === file
10
10
  if ((opts = opts.dup).delete :format) == 'svg' || (file.downcase.end_with? '.svg')
11
- #opts[:enable_file_requests_with_root] = (::File.dirname file) unless opts.key? :enable_file_requests_with_root
12
- #opts[:enable_web_requests] = allow_uri_read if !(opts.key? :enable_web_requests) && (respond_to? :allow_uri_read)
13
- #opts[:cache_images] = cache_uri if !(opts.key? :cache_images) && (respond_to? :cache_uri)
14
- #opts[:fallback_font_name] = fallback_svg_font_name if !(opts.key? :fallback_font_name) && (respond_to? :fallback_svg_font_name)
11
+ opts[:enable_web_requests] = (respond_to? :allow_uri_read) ? allow_uri_read : false unless opts.key? :enable_web_requests
15
12
  if (fit = opts.delete :fit) && !(opts[:width] || opts[:height])
16
13
  image_info = svg (::File.read file, mode: 'r:UTF-8'), opts do |svg_doc|
17
14
  # NOTE: fit to specified width, then reduce size if height exceeds bounds
@@ -3,4 +3,3 @@
3
3
  require 'prawn/icon'
4
4
  Prawn::Icon::Compatibility.prepend (Module.new { def warning *_args; end })
5
5
  require_relative 'prawn-icon/legacy'
6
- require_relative 'prawn-icon/interface'
@@ -6,6 +6,7 @@ Prawn::FLOAT_PRECISION = 1e-3
6
6
 
7
7
  # the following are organized under the Asciidoctor::Prawn namespace
8
8
  require_relative 'prawn/document/column_box'
9
+ require_relative 'prawn/document/internals'
9
10
  require_relative 'prawn/font_metric_cache'
10
11
  require_relative 'prawn/font/afm'
11
12
  require_relative 'prawn/font/ttf'
@@ -59,8 +59,9 @@ module Asciidoctor
59
59
 
60
60
  def find_primary_term name
61
61
  @categories.each_value do |category|
62
- term = category.terms.find {|candidate| candidate.name == name }
63
- return term if term
62
+ if (term = category.terms.find {|candidate| candidate.name == name })
63
+ return term
64
+ end
64
65
  end
65
66
  nil
66
67
  end
@@ -68,8 +69,7 @@ module Asciidoctor
68
69
  def link_associations group = nil
69
70
  if group
70
71
  group.terms.each do |term|
71
- associations = term.associations
72
- if (see_name = associations[:see])
72
+ if (see_name = (associations = term.associations)[:see])
73
73
  see_name = FormattedString.new see_name
74
74
  term.see = (find_primary_term see_name) || (UnresolvedIndexTerm.new see_name)
75
75
  elsif (see_also_names = associations[:see_also])
@@ -119,11 +119,10 @@ module Asciidoctor
119
119
  term.add_dest dest if dest
120
120
  term.associations ||= {}
121
121
  unless assoc.empty?
122
- if !term.associations[:see] && (see = assoc[:see])
123
- term.associations[:see] = see
124
- end
125
- if (see_also = assoc[:see_also])
126
- (term.associations[:see_also] ||= []).concat see_also
122
+ if (see = assoc[:see])
123
+ term.associations[:see] ||= see
124
+ elsif (see_also = assoc[:see_also])
125
+ (term.associations[:see_also] ||= ::Set.new).merge see_also
127
126
  end
128
127
  end
129
128
  term
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Asciidoctor
4
4
  module PDF
5
- VERSION = '2.3.27'
5
+ VERSION = '2.3.28'
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.27
4
+ version: 2.3.28
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: 2026-09-02 00:00:00.000000000 Z
12
+ date: 2026-11-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: asciidoctor
@@ -275,7 +275,6 @@ files:
275
275
  - lib/asciidoctor/pdf/ext/pdf-core/page.rb
276
276
  - lib/asciidoctor/pdf/ext/prawn-gmagick.rb
277
277
  - lib/asciidoctor/pdf/ext/prawn-icon.rb
278
- - lib/asciidoctor/pdf/ext/prawn-icon/interface.rb
279
278
  - lib/asciidoctor/pdf/ext/prawn-icon/legacy.rb
280
279
  - lib/asciidoctor/pdf/ext/prawn-svg.rb
281
280
  - lib/asciidoctor/pdf/ext/prawn-svg/calculators/document_sizing.rb
@@ -292,6 +291,7 @@ files:
292
291
  - lib/asciidoctor/pdf/ext/prawn.rb
293
292
  - lib/asciidoctor/pdf/ext/prawn/coderay_encoder.rb
294
293
  - lib/asciidoctor/pdf/ext/prawn/document/column_box.rb
294
+ - lib/asciidoctor/pdf/ext/prawn/document/internals.rb
295
295
  - lib/asciidoctor/pdf/ext/prawn/extensions.rb
296
296
  - lib/asciidoctor/pdf/ext/prawn/font/afm.rb
297
297
  - lib/asciidoctor/pdf/ext/prawn/font/ttf.rb
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Prawn::Icon::Interface
4
- def icon_font_data family
5
- ::Prawn::Icon::FontData.load self, family
6
- end
7
-
8
- def resolve_legacy_icon_name name
9
- ::Prawn::Icon::Legacy.mapping[%(fa-#{name})]
10
- end
11
- end