Vectors: escape file names
| @@ -23,7 +23,7 @@ import { | |||
| 23 | import { collapseNewlines, registerDebugFunction } from '../../power-user.js'; | 23 | import { collapseNewlines, registerDebugFunction } from '../../power-user.js'; |
| 24 | import { SECRET_KEYS, secret_state, writeSecret } from '../../secrets.js'; | 24 | import { SECRET_KEYS, secret_state, writeSecret } from '../../secrets.js'; |
| 25 | import { getDataBankAttachments, getDataBankAttachmentsForSource, getFileAttachment } from '../../chats.js'; | 25 | import { getDataBankAttachments, getDataBankAttachmentsForSource, getFileAttachment } from '../../chats.js'; |
| 26 | import { debounce, getStringHash as calculateHash, waitUntilCondition, onlyUnique, splitRecursive, trimToStartSentence, trimToEndSentence } from '../../utils.js'; | 26 | import { debounce, getStringHash as calculateHash, waitUntilCondition, onlyUnique, splitRecursive, trimToStartSentence, trimToEndSentence, escapeHtml } from '../../utils.js'; |
| 27 | import { debounce_timeout } from '../../constants.js'; | 27 | import { debounce_timeout } from '../../constants.js'; |
| 28 | import { getSortedEntries } from '../../world-info.js'; | 28 | import { getSortedEntries } from '../../world-info.js'; |
| 29 | import { textgen_types, textgenerationwebui_settings } from '../../textgen-settings.js'; | 29 | import { textgen_types, textgenerationwebui_settings } from '../../textgen-settings.js'; |
| @@ -565,7 +565,7 @@ async function vectorizeFile(fileText, fileName, collectionId, chunkSize, overla | |||
| 565 | 565 | ||
| 566 | const batchSize = getBatchSize(); | 566 | const batchSize = getBatchSize(); |
| 567 | const toastBody = $('<span>').text('This may take a while. Please wait...'); | 567 | const toastBody = $('<span>').text('This may take a while. Please wait...'); |
| 568 | const toast = toastr.info(toastBody, `Ingesting file ${fileName}`, { closeButton: false, escapeHtml: false, timeOut: 0, extendedTimeOut: 0 }); | 568 | const toast = toastr.info(toastBody, `Ingesting file ${escapeHtml(fileName)}`, { closeButton: false, escapeHtml: false, timeOut: 0, extendedTimeOut: 0 }); |
| 569 | const overlapSize = Math.round(chunkSize * overlapPercent / 100); | 569 | const overlapSize = Math.round(chunkSize * overlapPercent / 100); |
| 570 | const delimiters = getChunkDelimiters(); | 570 | const delimiters = getChunkDelimiters(); |
| 571 | // Overlap should not be included in chunk size. It will be later compensated by overlapChunks | 571 | // Overlap should not be included in chunk size. It will be later compensated by overlapChunks |
| @@ -1060,7 +1060,7 @@ async function onViewStatsClick() { | |||
| 1060 | toastr.info(`Total hashes: <b>${totalHashes}</b><br> | 1060 | toastr.info(`Total hashes: <b>${totalHashes}</b><br> |
| 1061 | Unique hashes: <b>${uniqueHashes}</b><br><br> | 1061 | Unique hashes: <b>${uniqueHashes}</b><br><br> |
| 1062 | I'll mark collected messages with a green circle.`, | 1062 | I'll mark collected messages with a green circle.`, |
| 1063 | `Stats for chat ${chatId}`, | 1063 | `Stats for chat ${escapeHtml(chatId)}`, |
| 1064 | { timeOut: 10000, escapeHtml: false }, | 1064 | { timeOut: 10000, escapeHtml: false }, |
| 1065 | ); | 1065 | ); |
| 1066 | 1066 | ||