asciidoctor-pdf 2.3.6 → 2.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +31 -0
- data/README.adoc +1 -1
- data/lib/asciidoctor/pdf/converter.rb +2 -1
- data/lib/asciidoctor/pdf/ext/core/file.rb +6 -0
- data/lib/asciidoctor/pdf/ext/prawn-table/cell/text.rb +2 -4
- data/lib/asciidoctor/pdf/formatted_text/inline_image_arranger.rb +9 -1
- data/lib/asciidoctor/pdf/optimizer.rb +3 -0
- data/lib/asciidoctor/pdf/sanitizer.rb +2 -2
- 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: 5a1b77004c38f0efc5a577f0ab5222f42b66398f70d5347e333d906616734aeb
|
4
|
+
data.tar.gz: 42ebc021e2b392e1b159ed0c473250b67d7e6c1f308dd7af282c61d6464538b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '03019b94151e1fdfc90e3d4cfc2cd25b115f936300e4982a0b62903108ed54429dbaee451b0b6d86a6b10d51a7db6da87acd0f34065773c2438f32fd0fd1e899'
|
7
|
+
data.tar.gz: f91b9506aa4242e9c253e0cbb5bce32666253a4af775891ab1378b5c3d48d390af45683f159fa9ce6cb26865da8f5f46320558e5929b57a41194958c83736eda
|
data/CHANGELOG.adoc
CHANGED
@@ -5,6 +5,37 @@
|
|
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.8 (2023-06-25) - @mojavelinux
|
9
|
+
|
10
|
+
Improvements::
|
11
|
+
|
12
|
+
* do not attempt to fit inline image in normal table cell to computed height of cell (#2428)
|
13
|
+
* support `fit=none` attribute on inline image to prevent image from being scaled down to fit available height (#2428)
|
14
|
+
|
15
|
+
Bug Fixes::
|
16
|
+
|
17
|
+
* remove null character enclosed in XML tag when santizing text; fixes invisible text in outline when heading contains index term (#2430)
|
18
|
+
* alias `File.exists?` to `File.exist?` when loading RGhost optimizer to patch incompatibility when using Ruby 3.2
|
19
|
+
|
20
|
+
Build / Infrastructure::
|
21
|
+
|
22
|
+
* bump upper Ruby version from 3.1 to 3.2 in CI workflow
|
23
|
+
|
24
|
+
=== Details
|
25
|
+
|
26
|
+
{url-repo}/releases/tag/v2.3.8[git tag] | {url-repo}/compare/v2.3.7\...v2.3.8[full diff]
|
27
|
+
|
28
|
+
== 2.3.7 (2023-04-16) - @mojavelinux
|
29
|
+
|
30
|
+
Bug Fixes::
|
31
|
+
|
32
|
+
* don't crash if source block with custom subs is empty and source highlighter is enabled
|
33
|
+
* add workaround for JRuby on Windows when value of `imagesdir` attribute is absolute and contains non-ASCII characters
|
34
|
+
|
35
|
+
=== Details
|
36
|
+
|
37
|
+
{url-repo}/releases/tag/v2.3.7[git tag] | {url-repo}/compare/v2.3.6\...v2.3.7[full diff]
|
38
|
+
|
8
39
|
== 2.3.6 (2023-04-09) - @mojavelinux
|
9
40
|
|
10
41
|
Bug Fixes::
|
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.8, 2023-06-25
|
4
4
|
// Settings:
|
5
5
|
:experimental:
|
6
6
|
:idprefix:
|
@@ -1079,8 +1079,9 @@ module Asciidoctor
|
|
1079
1079
|
callouts_enabled = false
|
1080
1080
|
end
|
1081
1081
|
subs[highlight_idx] = :specialcharacters
|
1082
|
+
source_string = node.content || ''
|
1082
1083
|
# NOTE: indentation guards will be added by the source highlighter logic
|
1083
|
-
source_string = expand_tabs unescape_xml (sanitize
|
1084
|
+
source_string = expand_tabs unescape_xml (sanitize source_string, compact: false) unless source_string.empty?
|
1084
1085
|
node.lines.replace saved_lines if saved_lines
|
1085
1086
|
end
|
1086
1087
|
else
|
@@ -1,6 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
File.singleton_class.prepend (Module.new do
|
4
|
+
# NOTE: see https://github.com/jruby/jruby/issues/7750
|
5
|
+
def absolute_path path, dir = nil
|
6
|
+
return super unless dir && !(absolute_path? path)
|
7
|
+
super File.join dir, path
|
8
|
+
end
|
9
|
+
|
4
10
|
# NOTE: JRuby < 9.4 doesn't implement this method; JRuby 9.4 implements it incorrectly
|
5
11
|
def absolute_path? path
|
6
12
|
(::Pathname.new path).absolute? && !(%r/\A[[:alpha:]][[:alnum:]\-+]*:\/\/\S/.match? path)
|
@@ -10,11 +10,9 @@ class Prawn::Table::Cell::Text
|
|
10
10
|
def draw_content
|
11
11
|
with_font do
|
12
12
|
self.valign = [:center, -font.descender * 0.5] if valign == :center
|
13
|
+
(bounds = @pdf.bounds).instance_variable_set :@table_cell, true
|
13
14
|
remaining_text = with_text_color do
|
14
|
-
(text_box
|
15
|
-
width: spanned_content_width + FPTolerance,
|
16
|
-
height: spanned_content_height + FPTolerance,
|
17
|
-
at: [0, @pdf.cursor]).render
|
15
|
+
(text_box width: bounds.width, height: bounds.height, at: [0, @pdf.cursor]).render
|
18
16
|
end
|
19
17
|
unless remaining_text.empty? || @pdf.scratch?
|
20
18
|
logger.error message_with_context %(the table cell on page #{@pdf.page_number} has been truncated; Asciidoctor PDF does not support table cell content that exceeds the height of a single page), source_location: @source_location
|
@@ -63,7 +63,15 @@ module Asciidoctor::PDF::FormattedText
|
|
63
63
|
image_w = [available_w, pctidx ? (image_w.to_f / 100 * available_w) : image_w.to_f].min
|
64
64
|
end
|
65
65
|
|
66
|
-
|
66
|
+
if (fit = fragment[:image_fit]) === 'line'
|
67
|
+
max_image_h = [available_h, doc.font.height].min
|
68
|
+
elsif fit == 'none'
|
69
|
+
max_image_h = doc.margin_box.height
|
70
|
+
elsif doc.bounds.instance_variable_get :@table_cell
|
71
|
+
max_image_h = doc.bounds.parent.height
|
72
|
+
else
|
73
|
+
max_image_h = available_h
|
74
|
+
end
|
67
75
|
|
68
76
|
# TODO: make helper method to calculate width and height of image
|
69
77
|
if image_format == 'svg'
|
@@ -6,6 +6,9 @@ require 'rghost/gs_alone'
|
|
6
6
|
require 'tmpdir'
|
7
7
|
autoload :Open3, 'open3'
|
8
8
|
|
9
|
+
# rghost still uses File.exists?
|
10
|
+
File.singleton_class.alias_method :exists?, :exist? unless File.respond_to? :exists?
|
11
|
+
|
9
12
|
RGhost::GSAlone.prepend (Module.new do
|
10
13
|
def initialize params, debug
|
11
14
|
(@params = params.dup).push(*(@params.pop.split File::PATH_SEPARATOR))
|
@@ -19,11 +19,11 @@ module Asciidoctor
|
|
19
19
|
'nbsp' => ' ',
|
20
20
|
'quot' => '"',
|
21
21
|
}).default = '?'
|
22
|
-
SanitizeXMLRx = /<[^>]
|
22
|
+
SanitizeXMLRx = /<[^>]+>\0?/
|
23
23
|
CharRefRx = /&(?:amp;)?(?:([a-z][a-z]+\d{0,2})|#(?:(\d\d\d{0,4})|x(\h\h\h{0,3})));/
|
24
24
|
UnescapedAmpersandRx = /&(?!(?:[a-z][a-z]+\d{0,2}|#(?:\d\d\d{0,4}|x\h\h\h{0,3}));)/
|
25
25
|
|
26
|
-
# Strip leading, trailing and repeating whitespace, remove XML tags and
|
26
|
+
# Strip leading, trailing and repeating whitespace, remove XML tags along with an enclosed null character, and
|
27
27
|
# resolve all entities in the specified string.
|
28
28
|
#
|
29
29
|
# FIXME: move to a module so we can mix it in elsewhere
|
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.8
|
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-
|
12
|
+
date: 2023-06-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: asciidoctor
|