Skip to content

Commit

Permalink
Make the 583 a clickable link
Browse files Browse the repository at this point in the history
  • Loading branch information
Genia Kazymova committed Oct 20, 2023
1 parent a059e5d commit 9ccb265
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.13
2.2.14
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<div>
<dt class="blacklight-<%= @key %> <%= @label_class %>"><%= label %></dt>
<% values.each do |v| %>
<%= v %>
<% if v.to_s.squish.downcase.include?("action note") %>
<%= clean_and_format_links(v).html_safe %>
<% else %>
<%= v %>
<% end %>
<% end %>
</div>
9 changes: 9 additions & 0 deletions app/components/trln_argon/metadata_field_layout_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,14 @@ def initialize(field:, label_class: '', value_class: '')
@label_class = label_class
@value_class = value_class
end

def clean_and_format_links(value)
value.to_s.tap do |cleaned_value|
cleaned_value.scan(%r{https://\S+}).each do |link|
cleaned_link = link.gsub(/\s+/, '')
cleaned_value.sub!(link, "<a href='#{cleaned_link}'>#{cleaned_link}</a>")
end
end
end
end
end

0 comments on commit 9ccb265

Please sign in to comment.