summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-07-11 03:25:02 -0600
committerDan Allen <dan.j.allen@gmail.com>2022-07-11 03:25:02 -0600
commit9d301228d4e83b3c0a218b3a04beeaaaa8c1dc04 (patch)
tree81a0794ddec2d1e3a7dcdfc60bea4851920930e4
parentc75f9a7f37fa00ceb0da1e1521a740abd17f51cf (diff)
configure table borders in way that is compatible with prawn-table > 0.2.2
-rw-r--r--CHANGELOG.adoc4
-rw-r--r--lib/asciidoctor/pdf/converter.rb7
2 files changed, 9 insertions, 2 deletions
diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc
index 85b761c3..157c21c8 100644
--- a/CHANGELOG.adoc
+++ b/CHANGELOG.adoc
@@ -16,6 +16,10 @@ Enhancements::
* add `--theme` option to CLI as shorthand for `-a pdf-theme` (#2250)
* add `--sourcemap` option to CLI to enable `:sourcemap` option on processor (#2265)
+Compliance::
+
+* configure table borders in way that is compatible with prawn-table > 0.2.2
+
== 2.1.5 (2022-07-10) - @mojavelinux
Bug Fixes::
diff --git a/lib/asciidoctor/pdf/converter.rb b/lib/asciidoctor/pdf/converter.rb
index b70eb20b..23071291 100644
--- a/lib/asciidoctor/pdf/converter.rb
+++ b/lib/asciidoctor/pdf/converter.rb
@@ -1436,7 +1436,8 @@ module Asciidoctor
end
max_term_width += (term_padding[1] + term_padding[3])
term_column_width = [max_term_width, bounds.width * 0.5].min
- table table_data, position: :left, cell_style: { border_width: 0 }, column_widths: [term_column_width] do
+ table table_data, position: :left, column_widths: [term_column_width] do
+ cells.style border_width: 0
@pdf.ink_table_caption node if node.title?
end
theme_margin :prose, :bottom, (next_enclosed_block actual_node) #unless actual_node.nested?
@@ -2213,10 +2214,10 @@ module Asciidoctor
# NOTE: position is handled by this method
position: :left,
# NOTE: the border color, style, and width of the outer frame is set in the table callback block
- cell_style: { border_color: grid_color.values, border_lines: grid_style.values, border_width: grid_width.values },
width: table_width,
column_widths: column_widths,
}
+ cell_style = { border_color: grid_color.values, border_lines: grid_style.values, border_width: grid_width.values }
# QUESTION: should we support nth; should we support sequence of roles?
case node.attr 'stripes', nil, 'table-stripes'
@@ -2232,6 +2233,8 @@ module Asciidoctor
left_padding = right_padding = nil
table table_data, table_settings do
+ # NOTE: cell_style must be applied manually to be compatible with both prawn-table 0.2.2 and prawn-table 0.2.3
+ cells.style cell_style
@column_widths = column_widths unless column_widths.empty?
# NOTE: call width to capture resolved table width
table_width = width