From 419e08f76089675a666df99bc46dcf24be1d82d3 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Sat, 3 Aug 2024 19:19:55 +0100 Subject: [PATCH] Parse markdown in misskey preview --- app/modules/misskey_preview.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/modules/misskey_preview.py b/app/modules/misskey_preview.py index 019c9cf..ea4b09a 100644 --- a/app/modules/misskey_preview.py +++ b/app/modules/misskey_preview.py @@ -38,7 +38,10 @@ class MisskeyPreviewModule(niobot.Module): username = data["user"]["username"] if not data["text"]: continue - text_body = "
%s
" % "".join(textwrap.shorten(data["text"], width=1000)) + + text = textwrap.shorten(data["text"], width=1000) + rendered = self.bot._markdown_to_html(text) + text_body = "
%s
" % rendered body = "@%s:
%s" % ( "https://%s/@%s" % (parsed.netloc, username), username,