From 4765d480216ba9634baca44d0ab5ceb876590ecc Mon Sep 17 00:00:00 2001 From: fish Date: Thu, 16 Jul 2026 21:44:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E9=9B=86=E7=AE=B1=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E5=AE=8C=E6=95=B4=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Note/ClipInboxViewController.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Note/ClipInboxViewController.swift b/Note/ClipInboxViewController.swift index 420fb8b..50ef908 100644 --- a/Note/ClipInboxViewController.swift +++ b/Note/ClipInboxViewController.swift @@ -246,6 +246,7 @@ extension ClipInboxViewController: UITableViewDataSource { var config = cell.defaultContentConfiguration() config.text = previewText(for: clip.text) + config.textProperties.numberOfLines = 0 config.secondaryText = formattedDate(clip.createdAt) config.secondaryTextProperties.color = .secondaryLabel cell.contentConfiguration = config @@ -255,9 +256,7 @@ extension ClipInboxViewController: UITableViewDataSource { } private func previewText(for text: String) -> String { - let lines = text.components(separatedBy: .newlines) - let firstTwoLines = Array(lines.prefix(2)) - let preview = firstTwoLines.joined(separator: " ").trimmingCharacters(in: .whitespaces) + let preview = text.trimmingCharacters(in: .whitespacesAndNewlines) if preview.isEmpty { return "(无内容)" }