This commit is contained in:
Timothy Jaeryang Baek
2026-06-17 00:15:04 +02:00
parent 966b3fdb57
commit 8b35ce924b
+3
View File
@@ -141,6 +141,9 @@ def truncate_content(content: str, max_chars: int, mode: str = 'middletruncate')
- start: keep first max_chars characters
- end: keep last max_chars characters
"""
if max_chars <= 0:
return ''
if not content or len(content) <= max_chars:
return content