fix: description line break preservation

This commit is contained in:
Schuwi
2025-09-19 20:49:46 +02:00
parent b68f8d92f7
commit 8fe199f50c

View File

@@ -931,9 +931,8 @@ defmodule ComponentsElixirWeb.ComponentsLive do
<%= if component.description do %> <%= if component.description do %>
<div> <div>
<h4 class="text-sm font-medium text-base-content mb-2">Description</h4> <h4 class="text-sm font-medium text-base-content mb-2">Description</h4>
<p class="text-sm text-base-content/70 leading-relaxed"> <%!-- Keep interpolation inline to prevent whitespace-pre-wrap from preserving template indentation --%>
{component.description} <p class="text-sm text-base-content/70 leading-relaxed whitespace-pre-wrap">{component.description}</p>
</p>
</div> </div>
<% end %> <% end %>
@@ -1082,9 +1081,8 @@ defmodule ComponentsElixirWeb.ComponentsLive do
<!-- Middle row: Description --> <!-- Middle row: Description -->
<%= if component.description do %> <%= if component.description do %>
<div class="mt-1"> <div class="mt-1">
<p class="text-sm text-base-content/70 line-clamp-2"> <%!-- Keep interpolation inline to prevent whitespace-pre-wrap from preserving template indentation --%>
{component.description} <p class="text-sm text-base-content/70 line-clamp-2 whitespace-pre-wrap">{component.description}</p>
</p>
</div> </div>
<% end %> <% end %>