asciidoctor-pdf 2.3.7 → 2.3.8

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: f1edfb9784918c61fecf4ae9023e92b2961442518878c826994159e8d3232cfb
4
- data.tar.gz: 8d55eac503e02ef1191e9827057e29271de5cfa37579f83a2282512699fd2374
3
+ metadata.gz: 5a1b77004c38f0efc5a577f0ab5222f42b66398f70d5347e333d906616734aeb
4
+ data.tar.gz: 42ebc021e2b392e1b159ed0c473250b67d7e6c1f308dd7af282c61d6464538b5
5
5
  SHA512:
6
- metadata.gz: 26174878c46dfbe3e7f5050945bab49727d8b963c1e95bc76125f7999b62262eda1f29cdeaf03bea86e55bc14a5e480d3f703ed841ce9e1cc5194f6046cd3924
7
- data.tar.gz: 9e2193b08b53f91f51c42175ce1d5ba7b589652da25f4e78d392be44e62a0249bd1b05c7ffbb5c9f18c753aefe6e60ad591f7774450d8c328fe3a4a8d5904424
6
+ metadata.gz: '03019b94151e1fdfc90e3d4cfc2cd25b115f936300e4982a0b62903108ed54429dbaee451b0b6d86a6b10d51a7db6da87acd0f34065773c2438f32fd0fd1e899'
7
+ data.tar.gz: f91b9506aa4242e9c253e0cbb5bce32666253a4af775891ab1378b5c3d48d390af45683f159fa9ce6cb26865da8f5f46320558e5929b57a41194958c83736eda
data/CHANGELOG.adoc CHANGED
@@ -5,6 +5,26 @@
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
+
8
28
  == 2.3.7 (2023-04-16) - @mojavelinux
9
29
 
10
30
  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.7, 2023-04-16
3
+ v2.3.8, 2023-06-25
4
4
  // Settings:
5
5
  :experimental:
6
6
  :idprefix:
@@ -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
- max_image_h = fragment[:image_fit] == 'line' ? [available_h, doc.font.height].min : available_h
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Asciidoctor
4
4
  module PDF
5
- VERSION = '2.3.7'
5
+ VERSION = '2.3.8'
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.7
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-04-16 00:00:00.000000000 Z
12
+ date: 2023-06-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: asciidoctor