Add new styling to search results; escape truncated output in templates

This commit is contained in:
swagg boi 2023-12-10 21:29:01 -05:00
parent 3997539df0
commit 4feeacd418
2 changed files with 12 additions and 3 deletions

View file

@ -1,5 +1,5 @@
% layout 'default';
% title 'Search Results';
% title scalar @{$search_results} ? 'Search Results' : 'Search';
<% content_for open_graph => begin %>
<meta property="og:type" content="website">
<meta property="og:title" content="<%= title %>">
@ -27,9 +27,18 @@
<% } =%>
</h4>
<h5 class="post__author"><%= $result->{'post_author'} %></h5>
<% if (299 < length $result->{'post_body'}) { =%>
<details class="post__body">
<summary>
<%= truncate_text $result->{'post_body'} %>
</summary>
<%== markdown $result->{'post_body'} =%>
</details>
<% } else { =%>
<div class="post__body">
<%== markdown truncate_text $result->{'post_body'} =%>
<%== markdown $result->{'post_body'} =%>
</div>
<% } =%>
</article>
<% } =%>
<% if ($last_page && $last_page != 1) { =%>

View file

@ -26,7 +26,7 @@
<% if (299 < length $thread->{'body'}) { =%>
<details class="post__body">
<summary>
<%== truncate_text $thread->{'body'} %>
<%= truncate_text $thread->{'body'} %>
</summary>
<%== markdown $thread->{'body'} =%>
</details>