mirror of
https://github.com/maubot/maubot
synced 2025-08-29 22:20:40 +00:00
Move interfaces to maubot package and other stuff to app/
This commit is contained in:
parent
ef8fffaff8
commit
3a27831112
14 changed files with 329 additions and 198 deletions
|
@ -19,9 +19,10 @@ package matrix
|
|||
import (
|
||||
"strings"
|
||||
"gopkg.in/russross/blackfriday.v2"
|
||||
"maubot.xyz"
|
||||
)
|
||||
|
||||
func RenderMarkdown(text string) map[string]interface{} {
|
||||
func RenderMarkdown(text string) maubot.Content {
|
||||
parser := blackfriday.New(
|
||||
blackfriday.WithExtensions(blackfriday.NoIntraEmphasis |
|
||||
blackfriday.Tables |
|
||||
|
@ -43,10 +44,10 @@ func RenderMarkdown(text string) map[string]interface{} {
|
|||
renderer.RenderFooter(&buf, ast)
|
||||
htmlBody := buf.String()
|
||||
|
||||
return map[string]interface{}{
|
||||
"formatted_body": htmlBody,
|
||||
"format": "org.matrix.custom.html",
|
||||
"msgtype": "m.text",
|
||||
"body": HTMLToText(htmlBody),
|
||||
return maubot.Content{
|
||||
FormattedBody: htmlBody,
|
||||
Format: maubot.FormatHTML,
|
||||
MsgType: maubot.MsgText,
|
||||
Body: HTMLToText(htmlBody),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue