Skip to content

Commit

Permalink
feat: APPS-2590 Summary field: add support for <br> and links (#1155)
Browse files Browse the repository at this point in the history
  • Loading branch information
kethlinmil authored Aug 29, 2024
1 parent 4763e7b commit e923913
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.metadata-block__label-value,
.metadata-block__label-value--ursus {
.metadata-block__label-value--ursus,
.metadata-block__group {
a {
text-decoration: none;
color: $ucla-darker-blue;
Expand Down
8 changes: 8 additions & 0 deletions app/helpers/ursus/catalog_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,13 @@ def render_truncated_description(args)
return description
end
end

# Parse links in the string and return html_safe result
#
# @param [String] string
# @return [ActiveSupport::SafeBuffer]
def autolink_string(string)
auto_link(string).html_safe # rubocop:disable Rails/OutputSafety
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<h2 class='metadata-block__title'>About this Collection</h2>
<div class='metadata-block__group'>
<p itemprop="abstract" class='collection-page__text'>
<%= document[:summary_tesim][0] %>
<%= autolink_string document[:summary_tesim][0] %>
</p>
</div>
<hr class='divider divider--ursus'>
Expand Down

0 comments on commit e923913

Please sign in to comment.