From 5ba9fa8ca50d5d46c6400acc9c34340864a2cba1 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 23 Oct 2019 16:09:20 +0100 Subject: [PATCH] Avoid long profile descriptions --- webinterface.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/webinterface.py b/webinterface.py index 6f60ed4f..6f215b87 100644 --- a/webinterface.py +++ b/webinterface.py @@ -1260,6 +1260,10 @@ def htmlProfile(translate: {},projectVersion: str, \ if len(profileDescription.split('
'))>2: profileDescriptionShort='' profileDescription=profileDescription.replace('
','\n') + # keep the profile description short + if len(profileDescriptionShort)>256: + profileDescriptionShort='' + # remove formatting from profile description used on title avatarDescription='' if profileJson.get('summary'): avatarDescription=profileJson['summary'].replace('
','\n').replace('

','').replace('

','') @@ -3233,6 +3237,10 @@ def htmlProfileAfterSearch(translate: {}, \ if '
' in profileDescription: if len(profileDescription.split('
'))>2: profileDescriptionShort='' + # keep the profile description short + if len(profileDescriptionShort)>256: + profileDescriptionShort='' + # remove formatting from profile description used on title avatarDescription='' if profileJson.get('summary'): avatarDescription=profileJson['summary'].replace('
','\n').replace('

','').replace('

','')