summaryrefslogtreecommitdiff
path: root/spec/section_spec.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-08-28 23:45:46 -0600
committerDan Allen <dan.j.allen@gmail.com>2022-08-29 02:45:57 -0600
commit28d7b643f9fab0920e8154ed1025359f67a781eb (patch)
tree6ffbb63feedf8b5e5b2cf9afb0a402d4e2a82d53 /spec/section_spec.rb
parent25c630cb94041bca3892e4dec7f32b136aa99615 (diff)
verify heading is advanced to next page to avoid breaking across page boundary
Diffstat (limited to 'spec/section_spec.rb')
-rw-r--r--spec/section_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/section_spec.rb b/spec/section_spec.rb
index a398ee35..cd4e0f9a 100644
--- a/spec/section_spec.rb
+++ b/spec/section_spec.rb
@@ -1071,6 +1071,22 @@ describe 'Asciidoctor::PDF::Converter - Section' do
(expect content_text[:page_number]).to be 2
end
+ it 'should force section title to next page if wrapped line does not fit on current page' do
+ pdf = with_content_spacer 10, 690 do |spacer_path|
+ to_pdf <<~EOS, pdf_theme: { heading_min_height_after: 0, heading_font_color: 'AA0000' }, analyze: true
+ image::#{spacer_path}[]
+
+ == This is a long heading that wraps to a second line
+
+ content
+ EOS
+ end
+
+ heading_texts = pdf.find_text font_color: 'AA0000'
+ (expect heading_texts).to have_size 2
+ (expect heading_texts.map {|it| it[:page_number] }.uniq).to eql [2]
+ end
+
it 'should force section title with text transform to next page to keep with first line of section content' do
pdf = to_pdf <<~EOS, pdf_theme: { heading_text_transform: 'uppercase' }, analyze: true
image::tall.svg[pdfwidth=80mm]