From 10e29240e0e05cc4a908069f72c8f81fa874191e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20=C2=ABMalo=C2=BB=20Skrylev?= Date: Wed, 8 Jun 2022 21:38:55 +0300 Subject: [PATCH] fix: allow to use text and text_box in sequence with inline format flag ! allow to use text and text_box in sequence with inline format flag --- lib/prawn/text.rb | 2 +- lib/prawn/text/box.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/prawn/text.rb b/lib/prawn/text.rb index 49097f42f..1c323a781 100644 --- a/lib/prawn/text.rb +++ b/lib/prawn/text.rb @@ -159,7 +159,7 @@ def text(string, options = {}) if p p = [] unless p.is_a?(Array) options.delete(:inline_format) - array = text_formatter.format(string, *p) + array = string.is_a?(Array) ? string : text_formatter.format(string, *p) else array = [{ text: string }] end diff --git a/lib/prawn/text/box.rb b/lib/prawn/text/box.rb index 63de01a26..2d64d8a55 100644 --- a/lib/prawn/text/box.rb +++ b/lib/prawn/text/box.rb @@ -111,7 +111,7 @@ def text_box(string, options = {}) if options[:inline_format] p = options.delete(:inline_format) p = [] unless p.is_a?(Array) - array = text_formatter.format(string, *p) + array = string.is_a?(Array) ? string : text_formatter.format(string, *p) Text::Formatted::Box.new(array, options) else Text::Box.new(string, options)