Skip to content

Commit

Permalink
revert inadvertent change to handle list in AsciiDoc table cell
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Sep 23, 2024
1 parent bcbad0f commit 2efbf05
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 1 addition & 2 deletions lib/asciidoctor/pdf/converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4745,8 +4745,7 @@ def admonition_icon_data key
end

def allocate_space_for_list_item line_metrics
# need to check ancestors for table_cell as well; perhaps helper in_table_cell?
advance_page if !(bounds.instance_variable_get :@table_cell) && !at_page_top? && cursor < line_metrics.height + line_metrics.leading + line_metrics.padding_top
advance_page if !at_page_top? && cursor < line_metrics.height + line_metrics.leading + line_metrics.padding_top
end

def apply_text_decoration styles, category, level = nil
Expand Down
2 changes: 0 additions & 2 deletions lib/asciidoctor/pdf/ext/prawn-table/cell/asciidoc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ def draw_content
pdf.bounds.instance_variable_set :@width, spanned_content_width
# NOTE: we've already reserved the space, so just let the box stretch to the maximum that could fit on a page
pdf.bounds.instance_variable_set :@height, (pdf.margin_box.height - padding_top - padding_bottom)
pdf.bounds.instance_variable_set :@table_cell, true
if @valign != :top && (excess_y = spanned_content_height - natural_content_height) > 0
# QUESTION: could this cause a unexpected page overrun?
pdf.move_down(@valign == :center ? (excess_y.fdiv 2) : excess_y)
Expand All @@ -92,7 +91,6 @@ def draw_content
doc.catalog[:footnotes] = parent_doc.catalog[:footnotes]
# TODO: apply horizontal alignment; currently it is necessary to specify alignment on content blocks
apply_font_properties { pdf.traverse content }
pdf.bounds.remove_instance_variable :@table_cell
if (extra_pages = pdf.page_number - start_page) > 0
unless extra_pages == 1 && pdf.page.empty?
logger.error message_with_context %(the table cell on page #{start_page} has been truncated; Asciidoctor PDF does not support table cell content that exceeds the height of a single page), source_location: @source_location
Expand Down

0 comments on commit 2efbf05

Please sign in to comment.