Parse markdown in misskey preview
This commit is contained in:
parent
8060430754
commit
419e08f760
1 changed files with 4 additions and 1 deletions
|
@ -38,7 +38,10 @@ class MisskeyPreviewModule(niobot.Module):
|
|||
username = data["user"]["username"]
|
||||
if not data["text"]:
|
||||
continue
|
||||
text_body = "<blockquote>%s</blockquote>" % "".join(textwrap.shorten(data["text"], width=1000))
|
||||
|
||||
text = textwrap.shorten(data["text"], width=1000)
|
||||
rendered = self.bot._markdown_to_html(text)
|
||||
text_body = "<blockquote>%s</blockquote>" % rendered
|
||||
body = "<a href=\"%s\">@%s:</a><br>%s" % (
|
||||
"https://%s/@%s" % (parsed.netloc, username),
|
||||
username,
|
||||
|
|
Loading…
Reference in a new issue