mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-21 19:18:44 -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
|
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}")
|
||||||
|
|||||||
Reference in New Issue
Block a user