mirror of
https://github.com/maubot/maubot
synced 2025-08-29 23:30:39 +00:00
Update gomatrix, add logging and other things
This commit is contained in:
parent
d261997d84
commit
ff26598910
14 changed files with 242 additions and 424 deletions
|
@ -20,15 +20,15 @@ import (
|
|||
"fmt"
|
||||
"math"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/net/html"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
var matrixToURL = regexp.MustCompile("^(?:https?://)?(?:www\\.)?matrix\\.to/#/([#@!].*)")
|
||||
|
||||
type htmlParser struct {}
|
||||
type htmlParser struct{}
|
||||
|
||||
type taggedString struct {
|
||||
string
|
||||
|
@ -124,13 +124,13 @@ func (parser *htmlParser) linkToString(node *html.Node, stripLinebreak bool) str
|
|||
}
|
||||
match := matrixToURL.FindStringSubmatch(href)
|
||||
if len(match) == 2 {
|
||||
// pillTarget := match[1]
|
||||
// if pillTarget[0] == '@' {
|
||||
// if member := parser.room.GetMember(pillTarget); member != nil {
|
||||
// return member.DisplayName
|
||||
// }
|
||||
// }
|
||||
// return pillTarget
|
||||
// pillTarget := match[1]
|
||||
// if pillTarget[0] == '@' {
|
||||
// if member := parser.room.GetMember(pillTarget); member != nil {
|
||||
// return member.DisplayName
|
||||
// }
|
||||
// }
|
||||
// return pillTarget
|
||||
return str
|
||||
}
|
||||
return fmt.Sprintf("%s (%s)", str, href)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue