Skip to content

Commit

Permalink
Mitigated super-linear backtracking in regex ↞ [auto-sync from `adaml…
Browse files Browse the repository at this point in the history
…ui/ai-web-extensions/googlegpt`]
  • Loading branch information
kudo-sync-bot committed Nov 14, 2024
1 parent 027998d commit ab9f127
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions chatgpt/googlegpt/googlegpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
// @description:zu Yengeza izimpendulo ze-AI ku-Google Search (inikwa amandla yi-Google Gemma + GPT-4o!)
// @author KudoAI
// @namespace https://kudoai.com
// @version 2024.11.14.2
// @version 2024.11.14.3
// @license MIT
// @icon https://media.googlegpt.io/images/icons/googlegpt/black/icon48.png?8652a6e
// @icon64 https://media.googlegpt.io/images/icons/googlegpt/black/icon64.png?8652a6e
Expand Down Expand Up @@ -854,7 +854,7 @@
+ `(v${latestVer}) ${app.msgs.alert_isAvail}! `
+ '<a target="_blank" rel="noopener" style="font-size: 0.97rem" '
+ 'href="' + app.urls.gitHub + '/commits/main/greasemonkey/'
+ app.urls.update.replace(/.*\/(.*)meta\.js/, '$1user.js') + '"'
+ app.urls.update.replace(/[^/]*\/([^/]*?)meta\.js/, '$1user.js') + '"'
+ `>${app.msgs.link_viewChanges}</a>`,
function update() { // button
GM_openInTab(app.urls.update.replace('meta.js', 'user.js') + '?t=' + Date.now(),
Expand Down Expand Up @@ -3507,14 +3507,15 @@
else api.tryNew(caller)
}

/* eslint-disable regexp/no-super-linear-backtracking */

Check failure on line 3510 in chatgpt/googlegpt/googlegpt.user.js

View workflow job for this annotation

GitHub Actions / eslint

Definition for rule 'regexp/no-super-linear-backtracking' was not found
function arrayify(strList) { // for get.related() calls
log.caller = 'dataProcess.text » arrayify()'
log.debug('Arrayifying related queries...')
return (strList.trim().match(/\d+\.?\s*(.+?)(?=\n|\\n|$)/g) || [])
return (strList.trim().match(/\d+\.?\s*([^\n]+?)(?=\n|\\n|$)/g) || [])
.slice(0, 5) // limit to 1st 5
.map(match => match.replace(/\*\*/g, '') // strip markdown boldenings
.replace(/^['"]*(?:\d+\.?\s*)?['"]*(.*?)['"]*$/g, '$1')) // strip numbering + quotes
}
} /* eslint-enable regexp/no-super-linear-backtracking */

Check failure on line 3518 in chatgpt/googlegpt/googlegpt.user.js

View workflow job for this annotation

GitHub Actions / eslint

Definition for rule 'regexp/no-super-linear-backtracking' was not found
})}
}

Expand Down

0 comments on commit ab9f127

Please sign in to comment.