Skip to content

Commit

Permalink
- Apply Nokogiri-based html formatting to all truncated fields throug…
Browse files Browse the repository at this point in the history
…hout the app, to fix and instance where unclosed html tags were causing issues with a research briefing
  • Loading branch information
j-corry committed Nov 25, 2024
1 parent c709bf7 commit 0719b9d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/views/search/results/item_details/_abstract.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% unless abstract.blank? %>
<div class="item-details">
<span>
<%= raw abstract[:value].truncate_words(50) %>
<%= raw format_html(abstract[:value], 50) %>
</span>
</div>
<% end %>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% unless contribution_text.blank? %>
<div class="item-details">
<span>
<%= raw contribution_text[:value].truncate_words(50) %>
<%= raw format_html(contribution_text[:value], 50) %>
</span>
</div>
<% end %>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% unless correction_text.blank? %>
<div class="item-details">
<span>
<%= raw correction_text[:value].truncate_words(50) %>
<%= raw format_html(correction_text[:value], 50) %>
</span>
</div>
<% end %>
8 changes: 4 additions & 4 deletions app/views/search/results/item_details/_description.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<div class="item-details">
<span>
<% if full_text == true %>
<%= raw description[:value] %>
<% else %>
<%= raw description[:value].truncate_words(50) %>
<% end %>
<%= raw format_html(description[:value], false) %>
<% else %>
<%= raw format_html(description[:value], 50) %>
<% end %>
</span>
</div>
<% end %>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% unless motion_text.blank? %>
<div class="item-details">
<span>
<%= raw motion_text[:value].truncate_words(50) %>
<%= raw format_html(motion_text[:value], 50) %>
</span>
</div>
<% end %>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% unless petition_text.blank? %>
<div class="item-details">
<span>
<%= raw petition_text[:value]&.truncate_words(50) %>
<%= raw format_html(petition_text[:value], 50) %>
</span>
</div>
<% end %>

0 comments on commit 0719b9d

Please sign in to comment.