Skip to content

Commit

Permalink
Merge pull request #260 from scientist-softserv/modify-snippet-rendering
Browse files Browse the repository at this point in the history
🐛 Return early for no snippets
  • Loading branch information
kirkkwang authored Jul 13, 2023
2 parents fbe418a + ec0b960 commit 4a3caaf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/helpers/iiif_print/iiif_print_helper_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ module IiifPrint::IiifPrintHelperBehavior
# @return [String] snippets HTML to be rendered
# rubocop:disable Rails/OutputSafety
def render_ocr_snippets(options = {})
# debugger
snippets = options[:value]
return if snippets.blank?

snippets_content = [content_tag('div',
"... #{snippets.first} ...".html_safe,
class: 'ocr_snippet first_snippet')]
Expand All @@ -19,4 +20,4 @@ def render_ocr_snippets(options = {})
snippets_content.join("\n").html_safe
end
# rubocop:enable Rails/OutputSafety
end
end

0 comments on commit 4a3caaf

Please sign in to comment.