make decorator only parse once

33347f1c7c74da7d45c903fc00636b63d67b144c

kwaroran <amasio1234@proton.me>

1 files changed, +5 -2Ignore whitespace
public/scripts/world-info.js+5 -2
@@ -3647,7 +3647,10 @@ async function checkWorldInfo(chat, maxContext, isDryRun) {
3647 for (let entry of sortedEntries) {3647 for (let entry of sortedEntries) {
36483648
3649 //oarse decorators3649 //oarse decorators
3650 const [decorators] = parseDecorators(entry.content);3650 const [decorators, content] = parseDecorators(entry.content);
3651 entry.decorators = decorators;
3652 entry.content = content;
3653
3651 if(decorators.includes('@@activate')){3654 if(decorators.includes('@@activate')){
3652 //activate in any case3655 //activate in any case
3653 activatedNow.add(entry);3656 activatedNow.add(entry);
@@ -3820,7 +3823,7 @@ async function checkWorldInfo(chat, maxContext, isDryRun) {
3820 } else { console.debug(`uid:${entry.uid} passed probability check, inserting to prompt`); }3823 } else { console.debug(`uid:${entry.uid} passed probability check, inserting to prompt`); }
38213824
3822 // Substitute macros inline, for both this checking and also future processing3825 // Substitute macros inline, for both this checking and also future processing
3823 entry.content = substituteParams(parseDecorators(entry.content)[1]);3826 entry.content = substituteParams(entry.content);
3824 newContent += `${entry.content}\n`;3827 newContent += `${entry.content}\n`;
38253828
3826 if ((textToScanTokens + (await getTokenCountAsync(newContent))) >= budget) {3829 if ((textToScanTokens + (await getTokenCountAsync(newContent))) >= budget) {