when using the same id in additional_text, the text is asked only once and then used in every occurrence. see #525

This commit is contained in:
mic 2026-02-14 23:23:07 +01:00
parent 5bbe379c0c
commit ae26e9288b

View file

@ -489,11 +489,16 @@ export const placeholdersUtils = {
const regex = /{%\s*additional_text(?::(.*?))?\s*%}/g;
let matches = [];
let match;
let foundIds = new Set();
while ((match = regex.exec(prompt_text)) !== null) {
matches.push({
placeholder: match[0],
info: match[1] ? match[1].trim() : ""
});
let info = match[1] ? match[1].trim() : "";
if (!foundIds.has(info)) {
foundIds.add(info);
matches.push({
placeholder: match[0],
info: info
});
}
}
return matches;
},