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