feat: markdown rendering + dark mode input fixes + DM icon align

- Add marked dependency; render post/reply content and signature via
  marked.parse (matches upstream). lib/markdown.js helper + CSS for
  code/pre/blockquote/tables in glass theme
- Fix hardcoded #e2e8f0 white inputs in dark mode: NewPost title/content,
  Modals report select, ReplyList, AdminForumSettings/Links/Users/Logs
- DM button: replace ✉️ emoji with upstream SVG chat bubble icon
This commit is contained in:
lezi-fun committed 2026-08-10 18:18:19 +08:00
1 parent bd6314be38
commit 1a8a588d60
14 files changed
+98 -22

No files matched your search

+3 -6
View File
@@ -7,6 +7,7 @@ import { useApp } from './AppProvider';
import ReplyList from './ReplyList';
import { Icon } from './Icons';
import ImageViewer from './ImageViewer';
import { renderMarkdown } from '@/lib/markdown';
function avatar(username) {
return 'https://ui-avatars.com/api/?name=' + encodeURIComponent(username || '匿名用户') +
@@ -155,9 +156,7 @@ export default function PostDetail({ postId }) {
)}
</div>
</div>
<div className="post-content" style={{ fontSize: 16, lineHeight: 1.8 }}>
{(post.content || '').split('\n').map((l, i) => <span key={i}>{l}<br /></span>)}
</div>
<div className="post-content" style={{ fontSize: 16, lineHeight: 1.8 }} dangerouslySetInnerHTML={{ __html: renderMarkdown(post.content) }} />
{post.images && post.images.length > 0 && (
<div className="post-images">
{post.images.map((img, i) => (
@@ -166,9 +165,7 @@ export default function PostDetail({ postId }) {
</div>
)}
{post.signature && (
<div style={{ marginTop: 16, paddingTop: 12, borderTop: '1px solid var(--border-light)', fontSize: 12, color: 'var(--text-secondary)' }}>
{post.signature}
</div>
<div style={{ marginTop: 16, paddingTop: 12, borderTop: '1px solid var(--border-light)', fontSize: 12, color: 'var(--text-secondary)' }} dangerouslySetInnerHTML={{ __html: renderMarkdown(post.signature) }} />
)}
</div>
<ReplyList postId={postId} onRefresh={load} />