asciidoctor-pdf 2.3.8 → 2.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +12 -1
- data/README.adoc +1 -1
- data/lib/asciidoctor/pdf/converter.rb +13 -7
- data/lib/asciidoctor/pdf/ext/core/file.rb +1 -1
- data/lib/asciidoctor/pdf/ext/prawn/extensions.rb +1 -1
- data/lib/asciidoctor/pdf/ext/prawn-svg/elements/image.rb +1 -1
- data/lib/asciidoctor/pdf/theme_loader.rb +1 -1
- data/lib/asciidoctor/pdf/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8c0a40b569d9103d197f7063f91e12ef370e22fe2b591cc628097ae78ac8dc2
|
4
|
+
data.tar.gz: af5b79bc2a7ce74f9bddd471bc6751c56ef0119b7c417a7bd5473d2f13638fbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2b0972adc236388028ecbd29af29f0bbd18889a2bd7229b2508769831db3882fd6123b500be4a11ce317c569e35fb5531dfafb1ffa7cd0a892199df50dcd33f
|
7
|
+
data.tar.gz: 25c2b33f2c6427ad23fbbb0215b8c9a0f0bc84312d6751b13a5ee664db9e7b44e2c4bbaab419d0e89e266644cb0714175c18b2d80da69396dfc32459a54f9ff4
|
data/CHANGELOG.adoc
CHANGED
@@ -5,6 +5,17 @@
|
|
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.9 (2023-06-28) - @mojavelinux
|
9
|
+
|
10
|
+
Bug Fixes::
|
11
|
+
|
12
|
+
* correctly align block image in raster format in column when align is right or center and page columns are enabled (#2433)
|
13
|
+
* honor table caption end placement (`table-caption-end` theme key) when `unbreakable` (or `breakable`) option is set on table (#2434)
|
14
|
+
|
15
|
+
=== Details
|
16
|
+
|
17
|
+
{url-repo}/releases/tag/v2.3.9[git tag] | {url-repo}/compare/v2.3.8\...v2.3.9[full diff]
|
18
|
+
|
8
19
|
== 2.3.8 (2023-06-25) - @mojavelinux
|
9
20
|
|
10
21
|
Improvements::
|
@@ -14,7 +25,7 @@ Improvements::
|
|
14
25
|
|
15
26
|
Bug Fixes::
|
16
27
|
|
17
|
-
* remove null character enclosed in XML tag when
|
28
|
+
* remove null character enclosed in XML tag when sanitizing text; fixes invisible text in outline when heading contains index term (#2430)
|
18
29
|
* alias `File.exists?` to `File.exist?` when loading RGhost optimizer to patch incompatibility when using Ruby 3.2
|
19
30
|
|
20
31
|
Build / Infrastructure::
|
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.9, 2023-06-28
|
4
4
|
// Settings:
|
5
5
|
:experimental:
|
6
6
|
:idprefix:
|
@@ -1856,9 +1856,16 @@ module Asciidoctor
|
|
1856
1856
|
update_colors if graphic_state.color_space.empty?
|
1857
1857
|
ink_caption node, category: :image, end: :top, block_align: alignment, block_width: rendered_w, max_width: caption_max_width if caption_end == :top && node.title?
|
1858
1858
|
image_y = y
|
1859
|
-
|
1859
|
+
left = bounds.left
|
1860
|
+
# NOTE: prawn does not compute :at for alignment correctly in column box, so resort to our own logic
|
1861
|
+
case alignment
|
1862
|
+
when :center
|
1863
|
+
left += (available_w - rendered_w) * 0.5
|
1864
|
+
when :right
|
1865
|
+
left += available_w - rendered_w
|
1866
|
+
end
|
1860
1867
|
# NOTE: specify both width and height to avoid recalculation
|
1861
|
-
embed_image image_obj, image_info,
|
1868
|
+
embed_image image_obj, image_info, at: [left, (image_cursor = cursor)], height: rendered_h, width: rendered_w
|
1862
1869
|
draw_image_border image_cursor, rendered_w, rendered_h, alignment unless pinned || (node.role? && (node.has_role? 'noborder'))
|
1863
1870
|
if (link = node.attr 'link')
|
1864
1871
|
add_link_to_image link, { width: rendered_w, height: rendered_h }, position: alignment, y: image_y
|
@@ -1974,6 +1981,7 @@ module Asciidoctor
|
|
1974
1981
|
end
|
1975
1982
|
|
1976
1983
|
def convert_table node
|
1984
|
+
caption_end = (theme = @theme).table_caption_end&.to_sym || :top
|
1977
1985
|
if !at_page_top? && ((unbreakable = node.option? 'unbreakable') || ((node.option? 'breakable') && (node.id || node.title?)))
|
1978
1986
|
# NOTE: we use the current node as the parent so we can navigate back into the document model
|
1979
1987
|
(table_container = Block.new node, :open) << (table_dup = node.dup)
|
@@ -1985,7 +1993,7 @@ module Asciidoctor
|
|
1985
1993
|
end
|
1986
1994
|
table_container.style = 'table-container'
|
1987
1995
|
table_container.id, table_dup.id = table_dup.id, nil
|
1988
|
-
if table_dup.title?
|
1996
|
+
if caption_end == :top && table_dup.title?
|
1989
1997
|
table_container.title = ''
|
1990
1998
|
table_container.instance_variable_set :@converted_title, table_dup.captioned_title
|
1991
1999
|
table_dup.title = nil
|
@@ -1997,7 +2005,6 @@ module Asciidoctor
|
|
1997
2005
|
num_rows = node.attr 'rowcount'
|
1998
2006
|
num_cols = node.columns.size
|
1999
2007
|
table_header_size = false
|
2000
|
-
theme = @theme
|
2001
2008
|
prev_font_scale, @font_scale = @font_scale, 1 if node.document.nested?
|
2002
2009
|
|
2003
2010
|
tbl_bg_color = resolve_theme_color :table_background_color
|
@@ -2235,7 +2242,6 @@ module Asciidoctor
|
|
2235
2242
|
alignment = theme.table_align&.to_sym || :left
|
2236
2243
|
end
|
2237
2244
|
|
2238
|
-
caption_end = theme.table_caption_end&.to_sym || :top
|
2239
2245
|
caption_max_width = theme.table_caption_max_width || 'fit-content'
|
2240
2246
|
|
2241
2247
|
table_settings = {
|
@@ -2267,7 +2273,7 @@ module Asciidoctor
|
|
2267
2273
|
@column_widths = column_widths unless column_widths.empty?
|
2268
2274
|
# NOTE: call width to capture resolved table width
|
2269
2275
|
table_width = width
|
2270
|
-
@pdf.ink_table_caption node, alignment, table_width, caption_max_width if
|
2276
|
+
@pdf.ink_table_caption node, alignment, table_width, caption_max_width if caption_end == :top && node.title?
|
2271
2277
|
# NOTE: align using padding instead of bounding_box as prawn-table does
|
2272
2278
|
# using a bounding_box across pages mangles the margin box of subsequent pages
|
2273
2279
|
if alignment != :left && table_width != (this_bounds = @pdf.bounds).width
|
@@ -2340,7 +2346,7 @@ module Asciidoctor
|
|
2340
2346
|
bounds.subtract_left_padding left_padding
|
2341
2347
|
bounds.subtract_right_padding right_padding if right_padding
|
2342
2348
|
end
|
2343
|
-
ink_table_caption node, alignment, table_width, caption_max_width, caption_end if
|
2349
|
+
ink_table_caption node, alignment, table_width, caption_max_width, caption_end if caption_end == :bottom && node.title?
|
2344
2350
|
theme_margin :block, :bottom, (next_enclosed_block node)
|
2345
2351
|
rescue ::Prawn::Errors::CannotFit
|
2346
2352
|
log :error, (message_with_context 'cannot fit contents of table cell into specified column width', source_location: node.source_location)
|
@@ -9,6 +9,6 @@ File.singleton_class.prepend (Module.new do
|
|
9
9
|
|
10
10
|
# NOTE: JRuby < 9.4 doesn't implement this method; JRuby 9.4 implements it incorrectly
|
11
11
|
def absolute_path? path
|
12
|
-
(
|
12
|
+
(Pathname.new path).absolute? && !(%r/\A[[:alpha:]][[:alnum:]\-+]*:\/\/\S/.match? path)
|
13
13
|
end
|
14
14
|
end) if RUBY_ENGINE == 'jruby'
|
@@ -4,7 +4,7 @@ Prawn::Font::AFM.instance_variable_set :@hide_m17n_warning, true
|
|
4
4
|
|
5
5
|
require 'prawn/icon'
|
6
6
|
|
7
|
-
Prawn::Icon::Compatibility.prepend (
|
7
|
+
Prawn::Icon::Compatibility.prepend (Module.new { def warning *_args; end })
|
8
8
|
|
9
9
|
module Asciidoctor
|
10
10
|
module Prawn
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Prawn::SVG::Elements::Image.prepend (Module.new do
|
4
4
|
def image_dimensions data
|
5
5
|
unless (handler = find_image_handler data)
|
6
|
-
raise
|
6
|
+
raise Prawn::SVG::Elements::Base::SkipElementError, 'Unsupported image type supplied to image tag'
|
7
7
|
end
|
8
8
|
image = handler.new data
|
9
9
|
[image.width.to_f, image.height.to_f]
|
@@ -22,7 +22,7 @@ module Asciidoctor
|
|
22
22
|
LoneVariableRx = /^\$([a-z0-9_-]+)$/
|
23
23
|
HexColorEntryRx = /^(?<k> *\p{Graph}+): +(?!null$)(?<q>["']?)(?<h>#)?(?<v>\h\h\h\h{0,3})\k<q> *(?:#.*)?$/
|
24
24
|
MultiplyDivideOpRx = %r((-?\d+(?:\.\d+)?) +([*/^]) +(-?\d+(?:\.\d+)?))
|
25
|
-
AddSubtractOpRx = /(-?\d+(?:\.\d+)?) +([
|
25
|
+
AddSubtractOpRx = /(-?\d+(?:\.\d+)?) +([+-]) +(-?\d+(?:\.\d+)?)/
|
26
26
|
PrecisionFuncRx = /^(round|floor|ceil)\(/
|
27
27
|
RoleAlignKeyRx = /(?:_text)?_align$/
|
28
28
|
|
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.9
|
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: 2023-06-
|
12
|
+
date: 2023-06-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: asciidoctor
|