summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/asciidoctor/pdf/converter.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/asciidoctor/pdf/converter.rb b/lib/asciidoctor/pdf/converter.rb
index e1b329ff..07199a40 100644
--- a/lib/asciidoctor/pdf/converter.rb
+++ b/lib/asciidoctor/pdf/converter.rb
@@ -1989,13 +1989,15 @@ module Asciidoctor
def convert_table node
if !at_page_top? && ((unbreakable = node.option? 'unbreakable') || ((node.option? 'breakable') && (node.id || node.title?)))
- (table_container = Block.new (table_dup = node.dup), :open) << table_dup
+ # NOTE: we use the current node as the parent so we can navigate back into the document model
+ (table_container = Block.new node, :open) << (table_dup = node.dup)
if unbreakable
table_dup.remove_attr 'unbreakable-option'
table_container.set_attr 'unbreakable-option'
else
table_dup.remove_attr 'breakable-option'
end
+ table_container.style = 'table-container'
table_container.id, table_dup.id = table_dup.id, nil
if table_dup.title?
table_container.title = ''
@@ -4055,7 +4057,9 @@ module Asciidoctor
end
siblings = siblings.flatten if parent_context == :dlist
if block != siblings[-1]
- (self_idx = siblings.index block) && siblings[self_idx + 1]
+ context == :open && block.style == 'table-container' ?
+ (next_enclosed_block parent) :
+ (self_idx = siblings.index block) && siblings[self_idx + 1]
elsif parent_context == :list_item || (parent_context == :open && parent.style != 'abstract') || parent_context == :section
next_enclosed_block parent
elsif list_item && (grandparent = parent.parent).context == :list_item