Support markdown in file description.

This commit is contained in:
2025-07-27 17:16:40 +08:00
parent def3e8bb0f
commit a416ff5562
3 changed files with 21 additions and 15 deletions

View File

@@ -15,6 +15,7 @@ import {
} from "react-icons/md";
import { useTranslation } from "react-i18next";
import { app } from "../app.ts";
import Markdown from "react-markdown";
export default function UserPage() {
const [user, setUser] = useState<User | null>(null);
@@ -336,9 +337,9 @@ function FilesList({
}
>
<h4 className={"font-bold pb-2"}>{file!.filename}</h4>
<p className={"text-sm whitespace-pre-wrap"}>
{file!.description}
</p>
<div className={"text-sm comment_tile"}>
<Markdown>{file.description.replaceAll("\n", " \n")}</Markdown>
</div>
<p className={"pt-1"}>
<Badge className={"badge-soft badge-secondary text-xs mr-2"}>
<MdOutlineArchive size={16} className={"inline-block"} />