mirror of
https://github.com/Rudi9719/kbtui.git
synced 2026-03-23 07:57:23 +00:00
added error handling
This commit is contained in:
@ -1,7 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -23,7 +22,10 @@ func emojiUnicodeConvert(s string) string {
|
|||||||
if matched := reeMatch.MatchString(word); matched {
|
if matched := reeMatch.MatchString(word); matched {
|
||||||
// renders a unicode emoji instead of the name
|
// renders a unicode emoji instead of the name
|
||||||
if temp, ok := emojiMap[word]; ok {
|
if temp, ok := emojiMap[word]; ok {
|
||||||
pStr[i] = renderUnicodeEmoji(temp)
|
emj, err := renderUnicodeEmoji(temp)
|
||||||
|
if err == nil {
|
||||||
|
pStr[i] = emj
|
||||||
|
} // else don't do anything to the string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user