When a user says "change the executive summary," the system:
- AI identifies the target: Determines if user wants entire text box or single element
- AI generates markdown: Creates clean bullet points like
• First point\n• Second point - System parses markdown: Identifies bullets, sub-bullets, plain text
- System generates XML: Converts to proper PowerPoint structure with bullet formatting
- System replaces content: Swaps entire text box content while preserving structure
User: "Change the executive summary"
→ AI: Text box replacement (entire content section)
→ Response: textBoxId: "TB1", slideNumber: 2
User: "Change the executive summary title"
→ AI: Single element replacement
→ Response: elementId: "2A"
User: "Use this template to make a deck about tortoises"
→ AI: Template detected (placeholder content like "Front cover template")
→ Response: action: "multi-slide" (replace all template content)
The AI automatically detects template files by looking for placeholder content:
- "Front cover template"
- "Test description"
- "Executive Summary" with generic content
- Other template-like placeholder text
When templates are detected, the AI defaults to multi-slide operations that replace all placeholder content with coordinated, themed content. This matches user intent - templates are meant to be completely transformed, not just have content added.
AI generates content in simple markdown:
• Main bullet point
• Another main point
• Sub-bullet (indented)
• Final main point
System converts markdown to PowerPoint XML by generating only the inner content:
<!-- Generated inner content (no <p:txBody> wrapper) --> <a:bodyPr spcFirstLastPara="1" wrap="square" lIns="0" tIns="0" rIns="0" bIns="0" anchor="t" anchorCtr="0"> <a:noAutofit/> </a:bodyPr> <a:lstStyle/> <a:p> <a:pPr marL="182880" lvl="0" indent="-173990" algn="l" rtl="0"> <a:buChar char="•"/> </a:pPr> <a:t>Main bullet point</a:t> </a:p>
The system then replaces the content between existing <p:txBody> tags to avoid XML structure corruption.
Text Box Replacement (entire content):
- User says: "change executive summary", "replace all bullets"
- AI returns:
textBoxId+slideNumber - System replaces: Entire
<p:txBody>content
Element Replacement (single item):
- User says: "change title", "replace first bullet"
- AI returns:
elementId - System replaces: Single
<a:t>tag
- Only handles body text boxes (bullets) for full replacement
- Sub-bullet indentation is simplified
- No support for complex formatting (bold, italic, etc.)
- Text box identification relies on placeholder type matching
Content duplication: Check if AI returned elementIds array instead of textBoxId
Missing bullets: Verify markdown parsing found bullet markers (•, -, *)
Wrong text box: Check if text box regex pattern matches the slide structure
XML corruption: Ensure generated content doesn't include <p:txBody> wrapper tags
PowerPoint repair needed: Usually indicates nested XML tags or missing required attributes