From e121523a423d396d11a0796b819d5b4852414c3f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 3 Jul 2022 04:13:25 +0200 Subject: [PATCH] fix accidential greentext in reddit mentions --- files/helpers/offsitementions.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/files/helpers/offsitementions.py b/files/helpers/offsitementions.py index b99d5f19f8..d02fbe0c66 100644 --- a/files/helpers/offsitementions.py +++ b/files/helpers/offsitementions.py @@ -44,10 +44,16 @@ def get_mentions(queries): if i['subreddit'] == 'PokemonGoRaids': continue if kind == 'comment': - text = f'

{i["body"]}

' + body = i["body"].replace('>', '> ') + text = f'

{body}

' else: - text = f'

{i["title"]}

' - if i["selftext"]: text += f'

{i["selftext"][:5000]}

' + title = i["title"].replace('>', '> ') + text = f'

{title}

' + + if i["selftext"]: + selftext = i["selftext"].replace('>', '> ')[:5000] + text += f'

{selftext}

' + mentions.append({ 'permalink': i['permalink'],