From 971c1777fd7576c2297b2a5d52e0d8559de8aaa5 Mon Sep 17 00:00:00 2001 From: Ibraheem Saleh Date: Wed, 18 Feb 2026 10:44:14 -0800 Subject: [PATCH] =?UTF-8?q?Remove=20letter=20truncation=20=E2=80=94=20show?= =?UTF-8?q?=20full=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- love_letters.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/love_letters.py b/love_letters.py index 5268727..f2c2b8a 100644 --- a/love_letters.py +++ b/love_letters.py @@ -53,17 +53,6 @@ def wrap_text(text: str, width: int = 78) -> str: return "\n\n".join(wrapped) -def truncate_letter(body: str, max_chars: int = 3000) -> str: - """Truncate very long letters with an ellipsis note.""" - if len(body) <= max_chars: - return body - truncated = body[:max_chars] - last_period = truncated.rfind(".") - if last_period > max_chars // 2: - truncated = truncated[: last_period + 1] - return truncated + "\n\n […letter continues…]" - - def display_letter(letter: dict) -> None: """Pretty-print a single love letter to the terminal.""" print() @@ -75,8 +64,7 @@ def display_letter(letter: dict) -> None: print(SEPARATOR) print() - body = truncate_letter(letter["body"]) - print(wrap_text(body)) + print(wrap_text(letter["body"])) print() print(SEPARATOR)