ai chat: make it work with online models

This commit is contained in:
end-4
2025-05-05 23:47:34 +02:00
parent e3cf6b37e8
commit 8d93f44509
6 changed files with 238 additions and 41 deletions
@@ -8,3 +8,10 @@ function getDomain(url) {
const match = url.match(/^(?:https?:\/\/)?(?:www\.)?([^\/]+)/);
return match ? match[1] : null;
}
function shellSingleQuoteEscape(str) {
// First escape backslashes, then escape single quotes
return String(str)
.replace(/\\/g, '\\\\')
.replace(/'/g, "'\\''");
}