Skip to content

Commit cd47b62

Browse files
committed
Condensed stripQueryAugments(), eliminated backtracking potential from regex ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/googlegpt]
1 parent 35f7fa6 commit cd47b62

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

chatgpt/googlegpt/googlegpt.user.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
// @description:zu Yengeza izimpendulo ze-AI ku-Google Search (inikwa amandla yi-Google Gemma + GPT-4o!)
150150
// @author KudoAI
151151
// @namespace https://kudoai.com
152-
// @version 2025.1.13.4
152+
// @version 2025.1.13.5
153153
// @license MIT
154154
// @icon https://assets.googlegpt.io/images/icons/googlegpt/black/icon48.png?v=59409b2
155155
// @icon64 https://assets.googlegpt.io/images/icons/googlegpt/black/icon64.png?v=59409b2
@@ -3487,8 +3487,7 @@
34873487
return msgChain.map(msg => { // stripped chain
34883488
if (msg.role == 'user') {
34893489
let content = msg.content
3490-
const augments = content.match(/\s*\{\{[^}]*\}\}\s*/g)
3491-
if (augments) augments.forEach(augment => content = content.replace(augment, ''))
3490+
content.match(/\{\{[^}]+\}\}/g)?.forEach(augment => content = content.replace(augment, ''))
34923491
return { ...msg, content: content.trim() }
34933492
} else return msg // agent's unstripped
34943493
})

0 commit comments

Comments
 (0)