feat(comments): add character limit to comment markdown body

Add an optional `$limit` parameter to `CommentPresenter::markdownBody()`
that truncates the comment body before rendering Markdown. The comment
partial now passes a default limit of 250 characters, preventing long
comments from dominating the layout. Unit tests cover rendering with and
without a limit.
This commit is contained in:
2026-08-16 10:15:08 +02:00
parent 4199a19dc3
commit 40fe75d9b7
3 changed files with 49 additions and 3 deletions
+1 -1
View File
@@ -14,7 +14,7 @@
@endif
</div>
<div class="mt-1 flex-grow w-full">
<div class="text-gray-700 dark:text-gray-200">{!! $comment->presenter()->markdownBody() !!}</div>
<div class="text-gray-700 dark:text-gray-200">{!! $comment->presenter()->markdownBody($limit ?? 250) !!}</div>
</div>
<div class="mt-2 space-x-2">
<span class="text-gray-500 dark:text-gray-300 font-medium">