we may need to expand short mentions more than once
This commit is contained in:
parent
dfca8b10f0
commit
4dc2ada944
9
fun.go
9
fun.go
|
@ -329,7 +329,11 @@ func memetize(honk *Honk) {
|
|||
var re_quickmention = regexp.MustCompile("(^| )@[[:alnum:]]+ ")
|
||||
|
||||
func quickrename(s string, userid int64) string {
|
||||
return re_quickmention.ReplaceAllStringFunc(s, func(m string) string {
|
||||
nonstop := true
|
||||
for nonstop {
|
||||
nonstop = false
|
||||
s = re_quickmention.ReplaceAllStringFunc(s, func(m string) string {
|
||||
log.Printf("m: %s", m)
|
||||
prefix := ""
|
||||
if m[0] == ' ' {
|
||||
prefix = " "
|
||||
|
@ -345,12 +349,15 @@ func quickrename(s string, userid int64) string {
|
|||
if err == nil {
|
||||
_, name := handles(xid)
|
||||
if name != "" {
|
||||
nonstop = true
|
||||
m = name
|
||||
}
|
||||
}
|
||||
return prefix + m + " "
|
||||
})
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
func mentionize(s string) string {
|
||||
s = re_mentions.ReplaceAllStringFunc(s, func(m string) string {
|
||||
|
|
Loading…
Reference in New Issue