make decorator only parse once
| @@ -3647,7 +3647,10 @@ async function checkWorldInfo(chat, maxContext, isDryRun) { | |||
| 3647 | for (let entry of sortedEntries) { | 3647 | for (let entry of sortedEntries) { |
| 3648 | 3648 | ||
| 3649 | //oarse decorators | 3649 | //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 case | 3655 | //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`); } |
| 3821 | 3824 | ||
| 3822 | // Substitute macros inline, for both this checking and also future processing | 3825 | // 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`; |
| 3825 | 3828 | ||
| 3826 | if ((textToScanTokens + (await getTokenCountAsync(newContent))) >= budget) { | 3829 | if ((textToScanTokens + (await getTokenCountAsync(newContent))) >= budget) { |