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:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user