asciidoctor-pdf 2.3.26 → 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 +4 -4
- data/CHANGELOG.adoc +29 -0
- data/README.adoc +1 -1
- data/lib/asciidoctor/pdf/converter.rb +9 -10
- data/lib/asciidoctor/pdf/ext/asciidoctor/document.rb +3 -3
- data/lib/asciidoctor/pdf/ext/prawn/document/internals.rb +11 -0
- data/lib/asciidoctor/pdf/ext/prawn/extensions.rb +13 -0
- data/lib/asciidoctor/pdf/ext/prawn/images.rb +1 -4
- data/lib/asciidoctor/pdf/ext/prawn-icon.rb +0 -1
- data/lib/asciidoctor/pdf/ext/prawn.rb +1 -0
- data/lib/asciidoctor/pdf/index_catalog.rb +8 -9
- data/lib/asciidoctor/pdf/version.rb +1 -1
- metadata +3 -3
- data/lib/asciidoctor/pdf/ext/prawn-icon/interface.rb +0 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '09ece6bf334a904f625c4b023c72e243e5b88a0a7ab1d2ae5d4bea42fd676371'
|
|
4
|
+
data.tar.gz: b2b8078cba29466b8cec473208ce07c225148386c7d59d5903e463a04f362e1e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 42483e2c20fd4ce68ef52cd8d0837b6a41c71306ef3f365c48bd32428e4bfb8641d2c7bc605da8666602a9b4ce2dc7566decf74037e2f5197021214102d204a3
|
|
7
|
+
data.tar.gz: f687499f7c8d29b374fe5e6d3ccf7cb2776ffbf26684c31c3ff6feb175e8b10d87592ab233c093e940373bb0acb9efe0ccbdb6f88817e8dc2046981802e52d5f
|
data/CHANGELOG.adoc
CHANGED
|
@@ -5,6 +5,34 @@
|
|
|
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
|
+
|
|
26
|
+
== 2.3.27 (2026-09-02) - @mojavelinux
|
|
27
|
+
|
|
28
|
+
Bug Fixes::
|
|
29
|
+
|
|
30
|
+
* honor attribute unset in AsciiDoc table cell when determining if attribute is unspecified
|
|
31
|
+
|
|
32
|
+
=== Details
|
|
33
|
+
|
|
34
|
+
{url-repo}/releases/tag/v2.3.27[git tag] | {url-repo}/compare/v2.3.26\...v2.3.27[full diff]
|
|
35
|
+
|
|
8
36
|
== 2.3.26 (2026-09-02) - @mojavelinux
|
|
9
37
|
|
|
10
38
|
Bug Fixes::
|
|
@@ -407,6 +435,7 @@ Enhancements::
|
|
|
407
435
|
* use default-for-print theme by default if media is `print` or `prepress` (#2306)
|
|
408
436
|
* support text alignment roles on all styled paragraphs
|
|
409
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)
|
|
410
439
|
|
|
411
440
|
Bug Fixes::
|
|
412
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.
|
|
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">#{
|
|
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">#{
|
|
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 =
|
|
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
|
-
|
|
2607
|
-
if (resolved_icon_set = FontAwesomeIconSets.find {|candidate|
|
|
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 =
|
|
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 =
|
|
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.
|
|
@@ -26,10 +26,10 @@ class Asciidoctor::Document
|
|
|
26
26
|
|
|
27
27
|
# Internal: Returns whether the specified attribute has never been set and is not locked.
|
|
28
28
|
def attr_unspecified? name
|
|
29
|
-
if
|
|
30
|
-
@parent_document.attr_unspecified? name
|
|
31
|
-
elsif (attribute_locked? name) || (@attributes_modified.include? name)
|
|
29
|
+
if (attribute_locked? name) || (@attributes_modified.include? name)
|
|
32
30
|
false
|
|
31
|
+
elsif nested?
|
|
32
|
+
@parent_document.attr_unspecified? name
|
|
33
33
|
else
|
|
34
34
|
(@options[:attributes] || {}).each_pair.none? do |k, v|
|
|
35
35
|
if k == name
|
|
@@ -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
|
-
|
|
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
|
|
@@ -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
|
-
|
|
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
|
|
123
|
-
term.associations[:see]
|
|
124
|
-
|
|
125
|
-
|
|
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
|
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.
|
|
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-
|
|
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
|