Merge pull request #643 from michael-lazar/title_index_error

Fix edge-case when printing terminal title
This commit is contained in:
Michael Lazar
2019-02-02 21:12:40 -05:00
committed by GitHub

View File

@@ -418,8 +418,11 @@ class Page(object):
# Set the terminal title
if len(sub_name) > 50:
title = sub_name.strip('/')
title = title.rsplit('/', 1)[1]
title = title.replace('_', ' ')
try:
title = title.rsplit('/', 1)[1]
except IndexError:
pass
else:
title = sub_name