Check that profile summary is a string

main
Bob Mottram 2020-06-28 10:32:11 +01:00
parent ab63c79bc6
commit da0c0b7e6e
1 changed files with 5 additions and 4 deletions

View File

@ -6076,11 +6076,12 @@ def htmlProfileAfterSearch(recentPostsCache: {}, maxRecentPosts: int,
# remove formatting from profile description used on title
avatarDescription = ''
if profileJson.get('summary'):
avatarDescription = profileJson['summary'].replace('<br>', '\n')
avatarDescription = avatarDescription.replace('<p>', '')
avatarDescription = avatarDescription.replace('</p>', '')
if isinstance(profileJson['summary'], str):
avatarDescription = profileJson['summary'].replace('<br>', '\n')
avatarDescription = avatarDescription.replace('<p>', '')
avatarDescription = avatarDescription.replace('</p>', '')
profileStr = ' <div class="hero-image">'
profileStr += ' <div class="hero-text">'
profileStr += ' <div class="hero-text">'
profileStr += \
' <img loading="lazy" src="' + avatarUrl + \
'" alt="' + avatarDescription + '" title="' + \