aboutsummaryrefslogtreecommitdiffstats
path: root/bot
diff options
context:
space:
mode:
authorGravatar ChrisJL <[email protected]>2021-08-30 10:04:12 +0100
committerGravatar GitHub <[email protected]>2021-08-30 10:04:12 +0100
commitc57fe085c0d1a3800d0bb070563af9ae592195b3 (patch)
treed0c1dd4e4150354932ae48a8d96eefb7e4476df9 /bot
parentMerge pull request #786 from camcaswell/duckduckduckgoose (diff)
parentMerge branch 'main' into escape-reddit-posts (diff)
Merge pull request #820 from python-discord/escape-reddit-posts
Escape markdown properly in post body to fix rendering on android
Diffstat (limited to 'bot')
-rw-r--r--bot/exts/evergreen/reddit.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/bot/exts/evergreen/reddit.py b/bot/exts/evergreen/reddit.py
index e57fa2c0..4df170c6 100644
--- a/bot/exts/evergreen/reddit.py
+++ b/bot/exts/evergreen/reddit.py
@@ -79,7 +79,8 @@ class Reddit(Cog):
text = data["selftext"]
if text:
- first_page += textwrap.shorten(text, width=100, placeholder="...").replace("*", "") + "\n"
+ text = escape_markdown(text).replace("[", "⦋").replace("]", "⦌")
+ first_page += textwrap.shorten(text, width=100, placeholder="...") + "\n"
ups = data["ups"]
comments = data["num_comments"]