From a6c9830513440ec099c9ef124f959c40f20b3dde Mon Sep 17 00:00:00 2001 From: Shana Moore Date: Mon, 16 Sep 2024 16:21:32 -0700 Subject: [PATCH] Fix handling of arrays with blank strings - Updated the logic to correctly identify arrays that contain only blank or empty strings. - Replaced `.blank?` check with `snippets.all?(&:blank?)` to ensure arrays like [""] are handled as blank. - This prevents issues where non-empty arrays with blank elements were not treated as blank. --- app/helpers/iiif_print/iiif_print_helper_behavior.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/iiif_print/iiif_print_helper_behavior.rb b/app/helpers/iiif_print/iiif_print_helper_behavior.rb index 8fb08866..92ca0899 100644 --- a/app/helpers/iiif_print/iiif_print_helper_behavior.rb +++ b/app/helpers/iiif_print/iiif_print_helper_behavior.rb @@ -7,7 +7,7 @@ module IiifPrint::IiifPrintHelperBehavior # rubocop:disable Rails/OutputSafety def render_ocr_snippets(options = {}) snippets = options[:value] - return if snippets.blank? + return if snippets.all?(&:blank?) snippets_content = [content_tag('div', "... #{snippets.first} ...".html_safe,