Build a module that suggests alt text for images in educational content. Since we can't run image recognition locally, focus on context-based suggestions: 1. Parse surrounding text (caption, paragraph, figure element) to infer image purpose 2. Detect common educational image patterns from filenames and paths (diagram, chart, graph, equation, photo) 3. Generate descriptive alt text templates: "[Type] showing [inferred subject].[context from surrounding text]" 4. Flag images that likely need human review (complex diagrams, photos) 5. Handle decorative images (suggest empty alt="") Input: HTML string. Output: Array<{ imgSrc: string, currentAlt: string, suggestedAlt: string, confidence: number, needsReview: boolean }> Write tests with realistic educational HTML samples.
No contributions yet.