Fix HTML output

This commit is contained in:
Nexus 2024-08-03 01:57:52 +01:00
parent 4387c25fe9
commit 3a92ba3b99
2 changed files with 3 additions and 5 deletions

View file

@ -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 = "<a href=\"%s\">@%s:</a>\n\n%s" % (
text_body = "<blockquote>%s</blockquote>" % "".join(textwrap.shorten(data["text"], width=1000))
body = "<a href=\"%s\">@%s:</a><br>%s" % (
"https://%s/@%s" % (parsed.netloc, username),
username,
"".join(text_body),
text_body,
)
await self.bot.send_message(
room,

View file