From 26c19e92f948c5d53ca7edf38362546b047afe80 Mon Sep 17 00:00:00 2001 From: Mohan Date: Fri, 14 Aug 2026 18:04:44 +0800 Subject: [PATCH] fix(component): strip nested ref in quote excerpt --- src/components/CommentSection.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/CommentSection.vue b/src/components/CommentSection.vue index 677c387..846bd54 100644 --- a/src/components/CommentSection.vue +++ b/src/components/CommentSection.vue @@ -57,8 +57,11 @@ function renderCommentContent(text: string): string { } function quoteExcerpt(comment: CommentResponse): string { - const s = (comment.content ?? '').replace(/\s+/g, ' ').trim() - return s.length > 40 ? s.slice(0, 40) + '…' : s + const raw = comment.content ?? '' + const stripped = raw.replace(/^/, '') + const s = stripped.replace(/\s+/g, ' ').trim() + const content = s.length > 30 ? s.slice(0, 30) + '…' : s + return `${comment.authorName ?? ''}:${content}` } function quoteComment(comment: CommentResponse) {