summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-05-26 12:06:24 -0600
committerGitHub <noreply@github.com>2022-05-26 12:06:24 -0600
commitd679ff1066326d37b91bb8285a36666033098873 (patch)
tree4e2ad44c58565400c5c89bdbefe0b8b1d90ac777 /spec
parentec79e059d7594c25e6864b0d5fe195ebdde8fdf4 (diff)
resolves #2210 do not filter TOC entries without an ID when computing TOC extent (PR #2211)
Diffstat (limited to 'spec')
-rw-r--r--spec/toc_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/toc_spec.rb b/spec/toc_spec.rb
index c7a7d809..7e78c931 100644
--- a/spec/toc_spec.rb
+++ b/spec/toc_spec.rb
@@ -221,6 +221,25 @@ describe 'Asciidoctor::PDF::Converter - TOC' do
(expect pdf.pages[3][:strings]).to include 'Chapter 1'
end
+ it 'should render all TOC entries when computing extent of TOC when sectids is unset' do
+ input = <<~EOS
+ = Document Title
+ :doctype: book
+ :pdf-page-size: A5
+ :toc:
+ :!sectids:
+
+ the preface
+
+ #{30.times.map {|idx| %(== Chapter #{idx + 1}) }.join ?\n}
+ EOS
+
+ pdf = to_pdf input, analyze: true
+ preface_text = pdf.find_unique_text 'the preface'
+ last_toc_entry_text = (pdf.find_text 'Chapter 30')[0]
+ (expect preface_text[:page_number]).to be > last_toc_entry_text[:page_number]
+ end
+
it 'should render descendants of section without ID when computing extent of TOC' do
input = <<~EOS
= Document Title