Browse Source

fix(component): strip nested ref in quote excerpt

main
Mohan 1 month ago
parent
commit
26c19e92f9
  1. 7
      src/components/CommentSection.vue

7
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(/^<ref:\d+>/, '')
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) {

Loading…
Cancel
Save