mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-22 03:28:45 -06:00
Use single character width for ellipsis entity
This commit is contained in:
@@ -260,8 +260,8 @@ def truncate_middle(value, length):
|
||||
return value
|
||||
|
||||
# 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]
|
||||
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}")
|
||||
|
||||
Reference in New Issue
Block a user