From 556eab9d896f28ecffa4fa398607cd26acc1c396 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Sat, 11 Apr 2026 11:06:38 +0300 Subject: [PATCH] Enha: handle $rightarrow$ --- bot.go | 4 +--- helpfuncs.go | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/bot.go b/bot.go index 3377390..246015a 100644 --- a/bot.go +++ b/bot.go @@ -125,8 +125,6 @@ var ( orModelsData *models.ORModels ) -var thinkBlockRE = regexp.MustCompile(`(?s).*?`) - // parseKnownToTag extracts known_to list from content using configured tag. // Returns cleaned content and list of character names. func parseKnownToTag(content string) []string { @@ -1101,7 +1099,7 @@ out: logger.Warn("failed to update storage", "error", err, "name", activeChatName) } // Strip think blocks before parsing for tool calls - respTextNoThink := thinkBlockRE.ReplaceAllString(respText.String(), "") + respTextNoThink := models.ThinkRE.ReplaceAllString(respText.String(), "") if interruptResp.Load() { return nil } diff --git a/helpfuncs.go b/helpfuncs.go index f8a85c3..bd60547 100644 --- a/helpfuncs.go +++ b/helpfuncs.go @@ -178,6 +178,7 @@ func colorText() { for i, tb := range thinkBlocks { text = strings.Replace(text, fmt.Sprintf(placeholderThink, i), tb, 1) } + text = strings.ReplaceAll(text, `$\rightarrow$`, "->") textView.SetText(text) }