Make URLs in homework answers and feedback clickable

Apply linkify() to student submission text (curator review page + student
cabinet: reviewed/approved/pending) and to curator feedback text, so pasted
links (e.g. Yandex.Disk) render as clickable anchors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-01 19:29:21 +05:00
parent 7c8e72cd94
commit d2094c9541
2 changed files with 7 additions and 5 deletions
@@ -1,6 +1,7 @@
import { prisma } from "@/lib/prisma";
import { notFound } from "next/navigation";
import Link from "next/link";
import { linkify } from "@/lib/linkify";
import { FeedbackForm } from "./feedback-form";
import { ContentTabs } from "./content-tabs";
import { DeleteSubmissionButton } from "./delete-button";
@@ -151,7 +152,7 @@ export default async function SubmissionPage({ params }: Props) {
className="px-4 py-3 text-sm whitespace-pre-wrap"
style={{ border: "2px solid var(--border)" }}
>
{submission.text}
{linkify(submission.text)}
</div>
) : (
<p className="text-sm italic" style={{ color: "var(--muted-foreground)" }}>