Skip to content

Commit e36a6a0

Browse files
fix: wrap full model card descriptions
1 parent 52f797c commit e36a6a0

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/components/models/ModelCard.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ const authorLogo = authorData[model.author]?.logo;
132132
</div>
133133

134134
<p
135-
class="text-muted-foreground mb-4 min-h-10 flex-1 text-sm leading-relaxed"
135+
class="text-muted-foreground mb-4 min-h-10 flex-1 text-sm leading-relaxed break-words"
136136
>
137137
{model.description}
138138
</p>

src/components/models/ModelCard.astro.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const truncationClasses = (className: string | undefined): string[] =>
2929
(className ?? "")
3030
.split(/\s+/)
3131
.filter((token) =>
32-
/^(?:line-clamp-(?:[1-9]\d*|\[[^\]]+\])|truncate$|overflow-(?:[xy]-)?(?:hidden|clip|ellipsis)$|text-ellipsis$|whitespace-nowrap$)/.test(
32+
/^(?:line-clamp-(?:[1-9]\d*|\[[^\]]+\])$|truncate$|overflow-(?:[xy]-)?(?:hidden|clip|ellipsis)$|text-ellipsis$|whitespace-nowrap$)/.test(
3333
token,
3434
),
3535
);
@@ -52,5 +52,6 @@ describe("ModelCard", () => {
5252
expect(title?.getAttribute("class")).toContain("break-words");
5353
expect(description?.textContent).toBe(model.description);
5454
expect(truncationClasses(description?.getAttribute("class"))).toEqual([]);
55+
expect(description?.getAttribute("class")).toContain("break-words");
5556
});
5657
});

0 commit comments

Comments
 (0)