Update feed.js

This commit is contained in:
Furrium Network authored and GitHub committed 2026-08-09 23:19:36 +08:00
1 parent ffea8d4b89
commit 97ab13447d
1 file changed
+6 -1
+6 -1
View File
@@ -43,15 +43,20 @@ function renderFeed() {
imagesHtml += '</div>';
}
const replyCount = p.reply_count || 0;
// Markdown 渲染
const renderedContent = marked ? marked.parse(p.content || '') : (p.content || '').replace(/\n/g, '<br>');
html += `
<div class="post-card" data-postid="${p.id}" style="cursor:pointer;">
<div class="post-header">
<img src="${avatar}" class="post-avatar" />
<span class="post-username" style="cursor:pointer;color:var(--primary);" onclick="event.stopPropagation();switchPage('user','${username}')">${username}</span>
<span class="post-time">${time}</span>
${p.edited_at ? '<span style="font-size:11px;color:var(--text-light);margin-left:6px;">(已编辑)</span>' : ''}
</div>
<div class="post-title">${p.title || '无标题'}</div>
<div class="post-content">${(p.content || '').replace(/\n/g, '<br>')}</div>
<div class="post-content">${renderedContent}</div>
${imagesHtml}
<div class="post-actions">
<span>