Use single character width for ellipsis entity

This commit is contained in:
Brian Tiemann
2026-01-21 19:44:42 -05:00
parent ba6124f0e0
commit 3874944def

View File

@@ -260,8 +260,8 @@ def truncate_middle(value, length):
return value return value
# Calculate split points for the two parts # Calculate split points for the two parts
half_len = (length - 3) // 2 # 3 for the '...' half_len = (length - 1) // 2 # 1 for the ellipsis
first_part = value[:half_len] first_part = value[:half_len]
second_part = value[len(value) - (length - 3 - half_len):] second_part = value[len(value) - (length - 1 - half_len):]
return mark_safe(f"{first_part}…{second_part}") return mark_safe(f"{first_part}…{second_part}")