- BoardRepository (thread/comment CRUD, soft-delete, search, pagination, pinned-first ordering) + BoardService (membership permission, author/admin edit/delete, comment->board_commented notification, board_posted/comment_added activity logs, category validation) - APIs: threads list/create/detail/edit/delete, comments create/edit/delete - MarkdownBody (react-markdown + remark-gfm + rehype-sanitize), ThreadForm, CommentForm, board list + thread detail screens, ProjectNav link - Unit tests (BoardRepository, BoardService) + e2e board.spec
21 lines
559 B
TypeScript
21 lines
559 B
TypeScript
import ReactMarkdown from 'react-markdown';
|
|
import remarkGfm from 'remark-gfm';
|
|
import rehypeSanitize from 'rehype-sanitize';
|
|
|
|
/**
|
|
* Markdown本文を安全にレンダリングする。
|
|
* HTML直接入力は無効化し、rehype-sanitize でサニタイズする。
|
|
*/
|
|
export function MarkdownBody({ bodyMd }: { bodyMd: string }) {
|
|
return (
|
|
<div className="prose prose-sm max-w-none">
|
|
<ReactMarkdown
|
|
remarkPlugins={[remarkGfm]}
|
|
rehypePlugins={[rehypeSanitize]}
|
|
>
|
|
{bodyMd}
|
|
</ReactMarkdown>
|
|
</div>
|
|
);
|
|
}
|