From 3a92ba3b9981621736fa0246d5232d36947fa4f6 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Sat, 3 Aug 2024 01:57:52 +0100 Subject: [PATCH] Fix HTML output --- app/modules/misskey_preview.py | 8 +++----- tox.init => tox.ini | 0 2 files changed, 3 insertions(+), 5 deletions(-) rename tox.init => tox.ini (100%) diff --git a/app/modules/misskey_preview.py b/app/modules/misskey_preview.py index a5ba535..019c9cf 100644 --- a/app/modules/misskey_preview.py +++ b/app/modules/misskey_preview.py @@ -38,13 +38,11 @@ class MisskeyPreviewModule(niobot.Module): username = data["user"]["username"] if not data["text"]: continue - text_body = [] - for line in textwrap.shorten(data["text"], width=1000).splitlines(keepends=True): - text_body.append("> " + (line or "\u200b")) - body = "@%s:\n\n%s" % ( + text_body = "
%s
" % "".join(textwrap.shorten(data["text"], width=1000)) + body = "@%s:
%s" % ( "https://%s/@%s" % (parsed.netloc, username), username, - "".join(text_body), + text_body, ) await self.bot.send_message( room, diff --git a/tox.init b/tox.ini similarity index 100% rename from tox.init rename to tox.ini