diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2023-06-28 05:05:50 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-28 05:05:50 -0600 |
| commit | beeb9a30dd055445873d79914fc16a5ce29ee1d5 (patch) | |
| tree | 247b2e3a76b91146219393923df5cc97216c7c24 /spec | |
| parent | 6f34121565b4bf21dac11d377de259083525f745 (diff) | |
resolves #2434 honor table caption end placement when unbreakable (or breakable) option is set on table (PR #2435)
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/table_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/table_spec.rb b/spec/table_spec.rb index e6d30756..8acfe2fb 100644 --- a/spec/table_spec.rb +++ b/spec/table_spec.rb @@ -3291,6 +3291,29 @@ describe 'Asciidoctor::PDF::Converter - Table' do (expect cell_a1_text[:page_number]).to be 2 end + it 'should honor caption end placement if %unbreakable option is set on table' do + pdf_theme = { table_caption_end: 'bottom' } + pdf = to_pdf <<~END, pdf_theme: pdf_theme, analyze: true + image::tall.svg[pdfwidth=75mm] + + .Title + [%unbreakable] + |=== + | Column A | Column B + + #{(1.upto 5).map {|idx| %(| A#{idx} | B#{idx}) }.join %(\n\n)} + |=== + END + + title_text = pdf.find_unique_text 'Table 1. Title' + (expect title_text[:page_number]).to be 2 + column_a_text = pdf.find_text 'Column A' + (expect column_a_text).to have_size 1 + column_a_text = column_a_text[0] + (expect column_a_text[:page_number]).to be 2 + (expect title_text[:y]).to be < column_a_text[:y] + end + it 'should keep caption with table if %breakable option is set on table' do pdf = to_pdf <<~END, analyze: true image::tall.svg[pdfwidth=80mm] |
