correctly handling empty body with no placeholders. see #614

This commit is contained in:
mic 2026-01-16 22:29:34 +01:00
parent 6e09bffaf1
commit 1d83c3a8c0

View file

@ -50,7 +50,9 @@ export const taPromptUtils = {
if(!placeholdersUtils.hasPlaceholder(curr_prompt.text)){
// no placeholders, do as usual
fullPrompt = curr_prompt.text + (String(curr_prompt.need_signature) == "1" ? " " + await taPromptUtils.getDefaultSignature():"") + " " + chatgpt_lang + " \"" + (selection_text=='' ? body_text : selection_text) + "\" ";
const signature = String(curr_prompt.need_signature) === "1" ? await taPromptUtils.getDefaultSignature() : "";
const content = selection_text || body_text;
fullPrompt = [curr_prompt.text, signature, chatgpt_lang, content ? `"${content}"` : ""].filter(Boolean).join(" ");
}else{
// we have at least a placeholder, do the magic!
// check if we have custom placeholders