1
0
mirror of https://github.com/Rudi9719/kbtui.git synced 2026-03-23 12:37:23 +00:00

Fix bug in colorRegex() that was highighting usernames in the middle of strings when a user wasn't actually being mentioned

This commit is contained in:
Sam
2019-10-24 22:20:25 -04:00
committed by Sam Hofius
parent 1a75ac8a49
commit f09f2969d9
2 changed files with 12 additions and 11 deletions

View File

@ -407,7 +407,7 @@ func formatChannel(ch keybase.Channel) StyledString {
}
func colorReplaceMentionMe(msg StyledString) StyledString {
return msg.colorRegex("(@?"+k.Username+")", mentionColor)
return msg.colorRegex(`(@?\b`+k.Username+`\b)`, mentionColor)
}
func colorUsername(username string) StyledString {
var color = messageSenderDefaultColor