Merge pull request 'Allow full description if there is no room to shorten' (#103) from fzzyyti/linkulator2:master into master

Reviewed-on: #103

Tested, fixes the issue described with minimal impact. Additional tests to be added in future PR.
This commit is contained in:
asdf 2021-08-17 10:38:59 +00:00
commit 34bd525b82
1 changed files with 4 additions and 1 deletions

View File

@ -74,7 +74,10 @@ def print_category_details(view_cat):
for link in category_details:
link_count += 1
thread_index[link_count] = link["postid"]
desc = textwrap.shorten(link["description"], width=desclen, placeholder="...")
if(desclen > 0):
desc = textwrap.shorten(link["description"], width=desclen, placeholder="...")
else:
desc = link["description"]
newmarker = (
"*" if link["last_modified_timestamp"] >= config.USER.lastlogin else ""
)