diff --git a/crates/zclaw-kernel/src/export/html.rs b/crates/zclaw-kernel/src/export/html.rs index 4e61ceb..16b5a57 100644 --- a/crates/zclaw-kernel/src/export/html.rs +++ b/crates/zclaw-kernel/src/export/html.rs @@ -218,11 +218,20 @@ impl HtmlExporter { fn format_scene_content(&self, content: &SceneContent) -> String { match content.scene_type { SceneType::Slide => { + let mut html = String::new(); if let Some(desc) = content.content.get("description").and_then(|v| v.as_str()) { - format!("

{}

", html_escape(desc)) - } else { - String::new() + html.push_str(&format!("

{}

", html_escape(desc))); } + if let Some(points) = content.content.get("key_points").and_then(|v| v.as_array()) { + let items: String = points.iter() + .filter_map(|p| p.as_str().map(|t| format!("
  • {}
  • ", html_escape(t)))) + .collect::>() + .join("\n"); + if !items.is_empty() { + html.push_str(&format!("

    Key Points

    \n", items)); + } + } + html } SceneType::Quiz => { let questions = content.content.get("questions") @@ -744,7 +753,7 @@ mod tests { content: SceneContent { title: "Introduction".to_string(), scene_type: SceneType::Slide, - content: serde_json::json!({"description": "Intro slide"}), + content: serde_json::json!({"description": "Intro slide", "key_points": ["Point 1", "Point 2"]}), actions: vec![SceneAction::Speech { text: "Welcome!".to_string(), agent_role: "teacher".to_string(), @@ -798,6 +807,20 @@ mod tests { assert_eq!(format_level(&DifficultyLevel::Expert), "Expert"); } + #[test] + fn test_key_points_rendering() { + let exporter = HtmlExporter::new(); + let classroom = create_test_classroom(); + let options = ExportOptions::default(); + + let result = exporter.export(&classroom, &options).unwrap(); + let html = String::from_utf8(result.content).unwrap(); + assert!(html.contains("

    Key Points

    ")); + assert!(html.contains("