Unexport `ParseBoldAndUnderline`
MODIFY
internal/ui/chatview.go
internal/ui/chatview.go
@@ -463,7 +463,7 @@ func (chatView *ChatView) formatMessage(message *discordgo.Message) string {
messageText = strings.Replace(messageText, wholeMatch, "\n"+escapedCode+"\n", 1)
}
- messageText = strings.Replace(strings.Replace(ParseBoldAndUnderline(messageText), "\\*", "*", -1), "\\_", "_", -1)
+ messageText = strings.Replace(strings.Replace(parseBoldAndUnderline(messageText), "\\*", "*", -1), "\\_", "_", -1)
shouldShow, contains := chatView.showSpoilerContent[message.ID]
if !contains || !shouldShow {
@@ -492,7 +492,7 @@ func (chatView *ChatView) formatMessage(message *discordgo.Message) string {
return fmt.Sprintf("[gray]%s %s [white]%s[\"\"][\"\"]", timeCellText, messageAuthor, messageText)
}
-func ParseBoldAndUnderline(messageText string) string {
+func parseBoldAndUnderline(messageText string) string {
messageTextTemp := make([]rune, 0)
firstBoldFound := false

MODIFY
internal/ui/chatview_test.go
internal/ui/chatview_test.go
@@ -90,7 +90,7 @@ func TestParseBoldAndUnderline(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
- if got := ParseBoldAndUnderline(tt.input); got != tt.want {
+ if got := parseBoldAndUnderline(tt.input); got != tt.want {
t.Errorf("ParseBoldAndUnderline() = '%v', want '%v'", got, tt.want)
}
})

Unexport `ParseBoldAndUnderline`