summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2020-07-31 23:39:44 -0600
committerDan Allen <dan.j.allen@gmail.com>2020-08-01 00:38:04 -0600
commitc7ebed2e6c004aa15f9c41dbac62beadd6cb29d3 (patch)
treeedd104ab51ba1eafe0e629dc16b203237e9b041f
parent27c11776c38e173308ff6cfc78f0a4d96206a732 (diff)
verify level-0 special section is treated as chapter in multipart book
-rw-r--r--spec/section_spec.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/section_spec.rb b/spec/section_spec.rb
index 22ebeb24..5e57db83 100644
--- a/spec/section_spec.rb
+++ b/spec/section_spec.rb
@@ -494,6 +494,33 @@ describe 'Asciidoctor::PDF::Converter - Section' do
(expect pdf.lines).to include 'A.1. Appendix Subsection'
end
+ it 'should treat level-0 special section as chapter in multipart book' do
+ pdf = to_pdf <<~'EOS', pdf_theme: { heading_h2_font_color: 'AA0000' }, analyze: true
+ = Document Title
+ :doctype: book
+
+ = Part
+
+ == Chapter
+
+ content
+
+ [appendix]
+ = Details
+
+ We let you know.
+ EOS
+
+ chapter_texts = pdf.find_text font_color: 'AA0000'
+ (expect chapter_texts).to have_size 2
+ chapter_text = chapter_texts[0]
+ (expect chapter_text[:string]).to eql 'Chapter'
+ (expect chapter_text[:page_number]).to eql 3
+ appendix_text = chapter_texts[1]
+ (expect appendix_text[:string]).to eql 'Appendix A: Details'
+ (expect appendix_text[:page_number]).to eql 4
+ end
+
it 'should not promote anonymous preface in book doctype to preface section if preface-title attribute is not set' do
input = <<~'EOS'
= Book Title