Skip to content

Commit ee89d55

Browse files
authored
Update server.js
1 parent f7dd302 commit ee89d55

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/npm/server.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -100,24 +100,24 @@ app.get('/wiki/:title', (req, res) => {
100100
<div class="comment-section">
101101
<h3>Comments</h3>
102102
${wiki.comments.slice(-7).map(comment => {
103+
return `
104+
<div class="comment" id="comment-${comment.id}">
105+
<div class="comment-author">
106+
${comment.author} <small>(${new Date(comment.createdAt).toLocaleString()})</small>
107+
</div>
108+
<div class="comment-content">${escapeHtml(comment.content)}</div>
109+
${comment.replies.length > 0 ? comment.replies.map(reply => {
103110
return `
104-
<div class="comment" id="comment-${comment.id}">
105-
<div class="comment-author">
106-
${comment.author} <small>(${new Date(comment.createdAt).toLocaleString()})</small>
107-
</div>
108-
<div class="comment-content">${escapeHtml(comment.content)}</div>
109-
${comment.replies.length > 0 ? comment.replies.map(reply => {
110-
return `
111-
<div class="comment-reply">
112-
<strong>${reply.author}</strong>: ${escapeHtml(reply.content)}
113-
<small>(${new Date(reply.createdAt).toLocaleString()})</small>
114-
</div>
115-
`;
116-
}).join('') : ''}
111+
<div class="comment-reply">
112+
<strong>${reply.author}</strong>: ${escapeHtml(reply.content)}
113+
<small>(${new Date(reply.createdAt).toLocaleString()})</small>
117114
</div>
118115
`;
119-
}).join('')}
116+
}).join('') : ''}
120117
</div>
118+
`;
119+
}).join('')}
120+
121121
122122
<div class="comment-form">
123123
<h3>Add a Comment</h3>

0 commit comments

Comments
 (0)