Enha: single backtick style

This commit is contained in:
Grail Finder
2026-01-13 11:02:57 +03:00
parent c942f4bfdb
commit 0f8fdae0e4
2 changed files with 2 additions and 0 deletions

View File

@@ -62,6 +62,7 @@ func colorText() {
// Step 2: Apply other regex styles to the non-code parts // Step 2: Apply other regex styles to the non-code parts
text = quotesRE.ReplaceAllString(text, `[orange::-]$1[-:-:-]`) text = quotesRE.ReplaceAllString(text, `[orange::-]$1[-:-:-]`)
text = starRE.ReplaceAllString(text, `[turquoise::i]$1[-:-:-]`) text = starRE.ReplaceAllString(text, `[turquoise::i]$1[-:-:-]`)
text = singleBacktickRE.ReplaceAllString(text, "`[pink::i]$1[-:-:-]`")
// text = thinkRE.ReplaceAllString(text, `[yellow::i]$1[-:-:-]`) // text = thinkRE.ReplaceAllString(text, `[yellow::i]$1[-:-:-]`)
// Step 3: Restore the styled code blocks from placeholders // Step 3: Restore the styled code blocks from placeholders
for i, cb := range codeBlocks { for i, cb := range codeBlocks {

View File

@@ -24,6 +24,7 @@ var (
starRE = regexp.MustCompile(`(\*.*?\*)`) starRE = regexp.MustCompile(`(\*.*?\*)`)
thinkRE = regexp.MustCompile(`(<think>\s*([\s\S]*?)</think>)`) thinkRE = regexp.MustCompile(`(<think>\s*([\s\S]*?)</think>)`)
codeBlockRE = regexp.MustCompile(`(?s)\x60{3}(?:.*?)\n(.*?)\n\s*\x60{3}\s*`) codeBlockRE = regexp.MustCompile(`(?s)\x60{3}(?:.*?)\n(.*?)\n\s*\x60{3}\s*`)
singleBacktickRE = regexp.MustCompile(`\x60([^\x60]*)\x60`)
roleRE = regexp.MustCompile(`^(\w+):`) roleRE = regexp.MustCompile(`^(\w+):`)
rpDefenitionSysMsg = ` rpDefenitionSysMsg = `
For this roleplay immersion is at most importance. For this roleplay immersion is at most importance.