summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-09-01 02:07:58 -0600
committerDan Allen <dan.j.allen@gmail.com>2022-09-01 02:07:58 -0600
commitb31cd4186aaf1c5a0a5540bb4e1db34b0279e117 (patch)
tree5acc3a907bcae375727e0eaeb0ce9ba796d9f83d /lib
parent7054785ec100ea28d853deb7d3caf79b18bc4153 (diff)
ensure heading-min-height-after theme key is ignored if section is empty or discrete heading is last child
Diffstat (limited to 'lib')
-rw-r--r--lib/asciidoctor/pdf/converter.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/asciidoctor/pdf/converter.rb b/lib/asciidoctor/pdf/converter.rb
index b8ee8c01..675fb3db 100644
--- a/lib/asciidoctor/pdf/converter.rb
+++ b/lib/asciidoctor/pdf/converter.rb
@@ -2864,6 +2864,8 @@ module Asciidoctor
theme_font :heading, level: (hlevel = opts[:level]) do
if (space_below = ::Numeric === min_height_after ? min_height_after : 0) > 0 && (node.context == :section ? node.blocks? : !node.last_child?)
space_below += @theme[%(heading_h#{hlevel}_margin_bottom)] || @theme.heading_margin_bottom
+ else
+ space_below = 0
end
h_padding_t, h_padding_r, h_padding_b, h_padding_l = expand_padding_value @theme[%(heading_h#{hlevel}_padding)]
h_fits = indent h_padding_l, h_padding_r do