diff --git a/src/components/CommentSection.vue b/src/components/CommentSection.vue index 846bd54..4cb298a 100644 --- a/src/components/CommentSection.vue +++ b/src/components/CommentSection.vue @@ -49,7 +49,7 @@ function renderCommentContent(text: string): string { const id = Number(refMatch[1]) const quoted = comments.value.find((c) => c.id === id) const excerpt = quoted ? quoteExcerpt(quoted) : `评论 #${id}` - html += `${escapeHtml(excerpt.replace(/\\/g, '>'))}` + html += `${escapeHtml(excerpt.replace(/\\/g, '>'))}` rest = text.slice(refMatch[0].length) } const body = escapeHtml(rest.replace(/\\/g, '>')) @@ -342,6 +342,7 @@ onMounted(() => { color: var(--ac-text); line-height: 22px; word-break: break-word; + white-space: pre-line; } .comment-star { @@ -406,7 +407,9 @@ onMounted(() => { } :deep(.comment-ref-tag) { - display: block; + display: flex; + align-items: center; + gap: 4px; width: fit-content; padding: 0 8px; margin-bottom: 6px; @@ -418,6 +421,10 @@ onMounted(() => { line-height: 20px; } +:deep(.comment-ref-icon) { + flex-shrink: 0; +} + .quote-preview { display: flex; align-items: center;