From 659d7d34b9746132fb170ddb3c3e837724fe43a1 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Wed, 8 Jun 2022 15:37:10 -0600 Subject: [PATCH] move column_box method override to Prawn extensions --- lib/asciidoctor/pdf/ext/prawn/document/column_box.rb | 8 -------- lib/asciidoctor/pdf/ext/prawn/extensions.rb | 6 ++++++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/asciidoctor/pdf/ext/prawn/document/column_box.rb b/lib/asciidoctor/pdf/ext/prawn/document/column_box.rb index 553d22a93..1b352d740 100644 --- a/lib/asciidoctor/pdf/ext/prawn/document/column_box.rb +++ b/lib/asciidoctor/pdf/ext/prawn/document/column_box.rb @@ -1,13 +1,5 @@ # frozen_string_literal: true -Prawn::Document.prepend (Module.new do - # Wraps the column_box method and automatically sets the height unless the :height option is specified. - def column_box point, options, &block - options[:height] = cursor unless options.key? :height - super - end -end) - Prawn::Document::ColumnBox.prepend (Module.new do attr_accessor :current_column diff --git a/lib/asciidoctor/pdf/ext/prawn/extensions.rb b/lib/asciidoctor/pdf/ext/prawn/extensions.rb index b3171fc27..01416d449 100644 --- a/lib/asciidoctor/pdf/ext/prawn/extensions.rb +++ b/lib/asciidoctor/pdf/ext/prawn/extensions.rb @@ -722,6 +722,12 @@ def span_page_width_if verdict end end + # Wraps the column_box method and automatically sets the height unless the :height option is specified. + def column_box point, options, &block + options[:height] = cursor unless options.key? :height + super + end + # A flowing version of bounding_box. If the content runs to another page, the cursor starts at # the top of the page instead of from the original cursor position. Similar to span, except # the :position option is limited to a numeric value and additional options are passed through