Skip to content

Commit

Permalink
fix: fix truncate with ellipsis method
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Apr 10, 2024
1 parent eb51690 commit 8470174
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/utils/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def clean_markdown_links(text_with_markdown):

def truncate_with_ellipsis(text, ellipsis_threshold=None, ellipsis_string="…"): # "(…)"
if ellipsis_threshold and len(text) > ellipsis_threshold:
text = text[: (ellipsis_threshold - len(ellipsis_string))] + f" {ellipsis_string}"
text = text[: (ellipsis_threshold - (len(ellipsis_string) + 1))] + f" {ellipsis_string}"
return text


Expand Down

0 comments on commit 8470174

Please sign in to comment.