asciidoctor-pdf 2.1.4 → 2.1.5

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: eb8baebe850d75fcfc95460fbbdf89978867adb076acf572abaff0f51e18fb04
4
- data.tar.gz: d4dbbaab4981db0666488ae108aee0f5851feb706e3846b13cd5cf46c341b5bc
3
+ metadata.gz: 0cacde45fb257acbe2644ae3da1673e0a9fe9cd42f4b97de92a3ae2d97400fdb
4
+ data.tar.gz: e4e01d9fa4e923e598277c5db822632a5dc3fe67e51ebbea26d744f8d30e7315
5
5
  SHA512:
6
- metadata.gz: 26b1c9830deeb0a39494e9cdb85fa5c2e2295efe8b3d527525b27c6dcf420a8ab94e06eeaca3431425e9cf547150d372bab49813af946cdd5ea0e155d6aad1f0
7
- data.tar.gz: d584830d1eb1f76a005b48cf6a20030311d40184254d4ddfbd752f99a66c27feab85292c79012af0c9c4b7272a1727f402828f1c6d992228660ccbf78be44d2a
6
+ metadata.gz: 2fadd03cc382136bf1387867d83d68396f58c4182a51616254562c1d6460e28e0555781e9c5c51d372cd6d3fee29f80b7c06d9fc0d6e055a2839cf63491bf92d
7
+ data.tar.gz: 6fa97a16ff15ac5b0dee3789d33aa2760595139299ae41eb4e0104b4346c8569ffb8f1377fd0844f2c98ec831a08156258754e2a54f25c9fb10972a681f0c592
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.1.5 (2022-07-10) - @mojavelinux
9
+
10
+ Bug Fixes::
11
+
12
+ * fix position of background color on caption with outside margin (#2271)
13
+ * don't allow font scale to compound when entering nested table (#2276)
14
+
15
+ === Details
16
+
17
+ {url-repo}/releases/tag/v2.1.5[git tag] | {url-repo}/compare/v2.1.4\...v2.1.5[full diff]
18
+
8
19
  == 2.1.4 (2022-06-26) - @mojavelinux
9
20
 
10
21
  Improvements::
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.1.4, 2022-06-26
3
+ v2.1.5, 2022-07-10
4
4
  // Settings:
5
5
  :experimental:
6
6
  :idprefix:
data/bin/asciidoctor-pdf CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- if File.file?(asciidoctor_pdf = (File.expand_path '../../lib/asciidoctor/pdf.rb', __FILE__))
4
+ if File.file? (asciidoctor_pdf = File.join (File.dirname __dir__), 'lib/asciidoctor/pdf.rb')
5
5
  require asciidoctor_pdf
6
6
  else
7
7
  require 'asciidoctor/pdf'
@@ -10,14 +10,14 @@ require 'asciidoctor/cli'
10
10
 
11
11
  options = Asciidoctor::Cli::Options.new backend: 'pdf', header_footer: true
12
12
 
13
- # FIXME provide an API in Asciidoctor for sub-components to print version information
13
+ # FIXME: provide an API in Asciidoctor for sub-components to print version information
14
14
  unless ARGV != ['-v'] && (ARGV & ['-V', '--version']).empty?
15
15
  $stdout.write %(Asciidoctor PDF #{Asciidoctor::PDF::VERSION} using )
16
16
  options.print_version
17
17
  exit 0
18
18
  end
19
19
 
20
- # FIXME This is a really bizarre API. Please make me simpler.
20
+ # FIXME: This is a really bizarre API. Please make me simpler.
21
21
  case (result = options.parse! ARGV)
22
22
  when Integer
23
23
  exit result
@@ -27,8 +27,6 @@ module Asciidoctor
27
27
 
28
28
  attr_accessor :font_scale
29
29
 
30
- attr_reader :root_font_size
31
-
32
30
  attr_reader :index
33
31
 
34
32
  attr_reader :theme
@@ -1996,6 +1994,7 @@ module Asciidoctor
1996
1994
  num_cols = node.columns.size
1997
1995
  table_header_size = false
1998
1996
  theme = @theme
1997
+ prev_font_scale, @font_scale = @font_scale, 1 if node.document.nested?
1999
1998
 
2000
1999
  tbl_bg_color = resolve_theme_color :table_background_color
2001
2000
  # QUESTION: should we fallback to page background color? (which is never transparent)
@@ -2135,7 +2134,7 @@ module Asciidoctor
2135
2134
  end
2136
2135
  # NOTE: line metrics get applied when AsciiDoc content is converted
2137
2136
  cell_line_metrics = nil
2138
- asciidoc_cell = ::Prawn::Table::Cell::AsciiDoc.new self, (cell_data.merge content: cell.inner_document, padding: body_cell_padding)
2137
+ asciidoc_cell = ::Prawn::Table::Cell::AsciiDoc.new self, (cell_data.merge content: cell.inner_document, padding: body_cell_padding, root_font_size: @root_font_size)
2139
2138
  cell_data = { content: asciidoc_cell, source_location: cell.source_location }
2140
2139
  end
2141
2140
  if cell_line_metrics
@@ -2339,6 +2338,8 @@ module Asciidoctor
2339
2338
  theme_margin :block, :bottom, (next_enclosed_block node)
2340
2339
  rescue ::Prawn::Errors::CannotFit
2341
2340
  log :error, (message_with_context 'cannot fit contents of table cell into specified column width', source_location: node.source_location)
2341
+ ensure
2342
+ @font_scale = prev_font_scale if prev_font_scale
2342
2343
  end
2343
2344
 
2344
2345
  def convert_thematic_break node
@@ -3103,7 +3104,8 @@ module Asciidoctor
3103
3104
  end
3104
3105
  unless scratch? || !(bg_color = @theme[%(#{category_caption}_background_color)] || @theme.caption_background_color)
3105
3106
  caption_height = height_of_typeset_text string
3106
- fill_at = [bounds.left, cursor + (margin[:top] || 0)]
3107
+ fill_at = [bounds.left, cursor]
3108
+ fill_at[1] -= (margin[:top] || 0) unless at_page_top?
3107
3109
  float { bounding_box(fill_at, width: container_width, height: caption_height) { fill_bounds bg_color } }
3108
3110
  end
3109
3111
  indent(*indent_by) do
@@ -7,6 +7,7 @@ module Prawn
7
7
  include ::Asciidoctor::Logging
8
8
 
9
9
  attr_accessor :align
10
+ attr_accessor :root_font_size
10
11
  attr_accessor :valign
11
12
 
12
13
  def initialize pdf, opts = {}
@@ -109,7 +110,7 @@ module Prawn
109
110
  prev_font_color, pdf.font_color = pdf.font_color, font_color if font_color
110
111
  font_family ||= font_info[:family]
111
112
  if font_size
112
- prev_font_scale, pdf.font_scale = pdf.font_scale, (font_size.to_f / @pdf.root_font_size)
113
+ prev_font_scale, pdf.font_scale = pdf.font_scale, (font_size.to_f / @root_font_size)
113
114
  else
114
115
  font_size = font_info[:size]
115
116
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Asciidoctor
4
4
  module PDF
5
- VERSION = '2.1.4'
5
+ VERSION = '2.1.5'
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.1.4
4
+ version: 2.1.5
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: 2022-06-26 00:00:00.000000000 Z
12
+ date: 2022-07-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: asciidoctor