diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2022-05-15 15:06:32 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2022-05-15 15:06:32 -0600 |
| commit | 87cd2d16a11838b736f8016a1f5886b633124a7b (patch) | |
| tree | 6e405c5b61dae49ba42fe61d5ab3c31341f150bb /spec | |
| parent | 8294aa6a671893740bbe487760f4c9727bb0d2bf (diff) | |
don't add entry to outline for notitle section if no content follows it
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/outline_spec.rb | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/spec/outline_spec.rb b/spec/outline_spec.rb index 7b3e5160..231934aa 100644 --- a/spec/outline_spec.rb +++ b/spec/outline_spec.rb @@ -643,6 +643,61 @@ describe 'Asciidoctor::PDF::Converter - Outline' do end end + context 'notitle section' do + it 'should add entry for visible section with notitle option' do + pdf = to_pdf <<~'EOS', debug: true + = Document Title + + == Section Present + + content + + [%notitle] + == Title for Outline + + content + EOS + + outline = extract_outline pdf + (expect outline[-1][:title]).to eql 'Title for Outline' + (expect (pdf.page 1).text).not_to include 'Title for Outline' + end + + it 'should not add entry for section with no blocks' do + pdf = to_pdf <<~'EOS', debug: true + = Document Title + + == Section Present + + content + + [%notitle] + == Section Not Present + EOS + + outline = extract_outline pdf + (expect outline[-1][:title]).to eql 'Section Present' + end + + it 'should not add entry for section on page which has been deleted' do + pdf = to_pdf <<~'EOS', debug: true + = Document Title + + == Section Present + + content + + <<< + + [%notitle] + == Section Not Present + EOS + + outline = extract_outline pdf + (expect outline[-1][:title]).to eql 'Section Present' + end + end + context 'Labels' do it 'should label front matter pages using roman numerals' do pdf = to_pdf <<~'EOS' |
