Merge pull request #4 from SillyTavern/staging

Staging
This commit is contained in:
PasserDreamer
2024-05-20 19:32:28 +08:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@@ -186,7 +186,7 @@ class WorldInfoBuffer {
result += '\n' + this.#recurseBuffer.join('\n'); result += '\n' + this.#recurseBuffer.join('\n');
} }
return this.#transformString(result, entry); return result;
} }
/** /**
@@ -204,6 +204,7 @@ class WorldInfoBuffer {
} }
// Otherwise we do normal matching of plaintext with the chosen entry settings // Otherwise we do normal matching of plaintext with the chosen entry settings
haystack = this.#transformString(haystack, entry);
const transformedString = this.#transformString(needle, entry); const transformedString = this.#transformString(needle, entry);
const matchWholeWords = entry.matchWholeWords ?? world_info_match_whole_words; const matchWholeWords = entry.matchWholeWords ?? world_info_match_whole_words;

View File

@@ -516,7 +516,8 @@ async function downloadGenericPng(url) {
*/ */
function parseRisuUrl(url) { function parseRisuUrl(url) {
// Example: https://realm.risuai.net/character/7adb0ed8d81855c820b3506980fb40f054ceef010ff0c4bab73730c0ebe92279 // Example: https://realm.risuai.net/character/7adb0ed8d81855c820b3506980fb40f054ceef010ff0c4bab73730c0ebe92279
const pattern = /^https?:\/\/realm\.risuai\.net\/character\/([a-f0-9]{64})$/; // or https://realm.risuai.net/character/7adb0ed8-d818-55c8-20b3-506980fb40f0
const pattern = /^https?:\/\/realm\.risuai\.net\/character\/([a-f0-9-]+)\/?$/i;
const match = url.match(pattern); const match = url.match(pattern);
return match ? match[1] : null; return match ? match[1] : null;
} }