summaryrefslogtreecommitdiff
path: root/spec/section_spec.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-04-27 04:28:52 -0600
committerDan Allen <dan.j.allen@gmail.com>2022-04-27 04:29:45 -0600
commitbd51a9dbc6fad55d5f2847449fd6f2b057cb52a1 (patch)
treea0a59eb09214df2200923ea83331946a96fe336f /spec/section_spec.rb
parentb61215ead9cc35c3ac9981bb50fd9ea30615226b (diff)
delete dests on page before deleting it
Diffstat (limited to 'spec/section_spec.rb')
-rw-r--r--spec/section_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/section_spec.rb b/spec/section_spec.rb
index 4f36430d..a0fe54f6 100644
--- a/spec/section_spec.rb
+++ b/spec/section_spec.rb
@@ -748,6 +748,25 @@ describe 'Asciidoctor::PDF::Converter - Section' do
(expect appendix_text[:page_number]).to be 5
end
+ it 'should not leave behind dest for empty section marked with untitled option' do
+ pdf = to_pdf <<~'EOS'
+ = Document Title
+ :doctype: book
+
+ == Chapter
+
+ Musings.
+
+ [colophon%untitled]
+ == Hidden
+ EOS
+
+ (expect pdf.pages).to have_size 2
+ all_text = pdf.pages.map(&:text).join ?\n
+ (expect all_text).not_to include 'Hide Me'
+ (expect get_names pdf).not_to have_key '_hidden'
+ 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