summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--helpfuncs.go1
-rw-r--r--tools.go1
2 files changed, 2 insertions, 0 deletions
diff --git a/helpfuncs.go b/helpfuncs.go
index 0efed05..73f8fb0 100644
--- a/helpfuncs.go
+++ b/helpfuncs.go
@@ -62,6 +62,7 @@ func colorText() {
// Step 2: Apply other regex styles to the non-code parts
text = quotesRE.ReplaceAllString(text, `[orange::-]$1[-:-:-]`)
text = starRE.ReplaceAllString(text, `[turquoise::i]$1[-:-:-]`)
+ text = singleBacktickRE.ReplaceAllString(text, "`[pink::i]$1[-:-:-]`")
// text = thinkRE.ReplaceAllString(text, `[yellow::i]$1[-:-:-]`)
// Step 3: Restore the styled code blocks from placeholders
for i, cb := range codeBlocks {
diff --git a/tools.go b/tools.go
index e5bdd1b..f36e240 100644
--- a/tools.go
+++ b/tools.go
@@ -24,6 +24,7 @@ var (
starRE = regexp.MustCompile(`(\*.*?\*)`)
thinkRE = regexp.MustCompile(`(<think>\s*([\s\S]*?)</think>)`)
codeBlockRE = regexp.MustCompile(`(?s)\x60{3}(?:.*?)\n(.*?)\n\s*\x60{3}\s*`)
+ singleBacktickRE = regexp.MustCompile(`\x60([^\x60]*)\x60`)
roleRE = regexp.MustCompile(`^(\w+):`)
rpDefenitionSysMsg = `
For this roleplay immersion is at most importance.