summaryrefslogtreecommitdiff
path: root/spec/section_spec.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-07-16 23:49:48 -0600
committerGitHub <noreply@github.com>2022-07-16 23:49:48 -0600
commite9e7261ac39fab925bcb40555aed21edf050c2b7 (patch)
tree2cc858e2b4571785b5bb7d43c4f29dcaf907040d /spec/section_spec.rb
parent366ff8814b7117170c740d1a1efb08da05b7cfcd (diff)
resolves #2268 allow orphan detection to be enabled for all section titles and discrete headings using theme (PR #2283)
Diffstat (limited to 'spec/section_spec.rb')
-rw-r--r--spec/section_spec.rb26
1 files changed, 25 insertions, 1 deletions
diff --git a/spec/section_spec.rb b/spec/section_spec.rb
index 332ea23d..cd768442 100644
--- a/spec/section_spec.rb
+++ b/spec/section_spec.rb
@@ -1099,7 +1099,7 @@ describe 'Asciidoctor::PDF::Converter - Section' do
end
it 'should keep section with first block of content if breakable option is set on section' do
- pdf = to_pdf <<~EOS, analyze: true
+ pdf = to_pdf <<~EOS, pdf_theme: { heading_min_height_after: nil }, analyze: true
== Section A
image::tall.svg[pdfwidth=70mm]
@@ -1123,6 +1123,30 @@ describe 'Asciidoctor::PDF::Converter - Section' do
(expect content_text[:page_number]).to be 2
end
+ it 'should keep section with first block of content if heading_min_height_after key is auto' do
+ pdf = to_pdf <<~EOS, pdf_theme: { heading_min_height_after: 'auto' }, analyze: true
+ == Section A
+
+ image::tall.svg[pdfwidth=70mm]
+
+ == Section B
+
+ [%unbreakable]
+ --
+ keep
+
+ this
+
+ together
+ --
+ EOS
+
+ section_b_text = pdf.find_unique_text 'Section B'
+ (expect section_b_text[:page_number]).to be 2
+ content_text = pdf.find_unique_text 'keep'
+ (expect content_text[:page_number]).to be 2
+ end
+
it 'should not add break before chapter if heading-chapter-break-before key in theme is auto' do
pdf = to_pdf <<~'EOS', pdf_theme: { heading_chapter_break_before: 'auto' }, analyze: true
= Document Title