feat(frontend): Markdown 支持 GFM、代码高亮与图片灯箱

统一 SSR/客户端渲染路径,评论与预览共用增强组件。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-16 05:41:25 +08:00
parent f3145b24ff
commit 2056d6a3f9
14 changed files with 1458 additions and 31 deletions

View File

@@ -17,7 +17,7 @@ import {
} from "lucide-react";
import { apiUploadPostImage } from "@/lib/api";
import { toast } from "@/lib/toast";
import MarkdownBody from "@/components/MarkdownBody";
import MarkdownBodyClient from "@/components/MarkdownBodyClient";
type MarkdownEditorProps = {
value: string;
@@ -304,7 +304,7 @@ export default function MarkdownEditor({
) : (
<div className="j13-md-preview">
{value.trim() ? (
<MarkdownBody content={value} />
<MarkdownBodyClient content={value} />
) : (
<p className="meta text-center py-16">暂无内容可预览</p>
)}