Fix: Support multiple character variants in Present Characters panel
Fixed issues when AI generates multiple character variants (e.g., storyteller mode with 'Dottore (Prime)', 'Dottore (Beta)', etc.): 1. Escape quotes in character names to prevent HTML attribute breakage - Added escapeHtmlAttr() helper function - Prevents names like 'Marianna "Mari"' from breaking HTML 2. Restore avatar lookup for character variants - namesMatch() now strips parentheses and quotes from both sides - Allows 'Dottore (Prime)' to find 'Dottore' character card avatar - Each variant still gets its own card with separate attributes 3. Multiple characters now display correctly in panel - Each variant creates its own character object - Attributes (Details, Relationship, Stats, Thoughts) don't mix - All characters appear in the panel, not just the last one
This commit is contained in:
@@ -256,7 +256,7 @@ export function generateTrackerInstructions(includeHtmlPrompt = true, includeCon
|
||||
|
||||
// Relationship line (only if relationships are enabled)
|
||||
if (relationshipPlaceholders) {
|
||||
instructions += `Relationship: [${relationshipPlaceholders}]\n`;
|
||||
instructions += `Relationship: [(choose one: ${relationshipPlaceholders})]\n`;
|
||||
}
|
||||
|
||||
// Stats line (if enabled)
|
||||
|
||||
Reference in New Issue
Block a user