diff --git a/src/render.rs b/src/render.rs index 2e018ab..6585d3a 100644 --- a/src/render.rs +++ b/src/render.rs @@ -23,7 +23,7 @@ pub fn render_page(template: &str, config: &Config, entries: &[Entry], form_html pub fn render_form(config: &Config) -> String { let website_section = if config.enable_website_links { format!( - "\n\n\n", + "\n\n\n", config.label_website ) } else { @@ -32,7 +32,7 @@ pub fn render_form(config: &Config) -> String { let captcha_section = if config.enable_captcha { format!( - "\n\n\n", + "\n\n\n", config.captcha_question ) } else { @@ -176,11 +176,11 @@ pub fn render_form(config: &Config) -> String { format!( r#"{prompt}
- - + + {website_section} - - + + {captcha_section} {drawing_section}{voice_note_section}
"#, @@ -216,7 +216,6 @@ pub fn render_error_page(config: &Config, error: &str) -> String { } else { &config.style }; - let error = escape_html(error); format!( r#" @@ -281,9 +280,8 @@ fn render_entry(entry: &Entry, config: &Config) -> String { }; let drawing_html = if !entry.meta.drawing.is_empty() { format!( - "\"Drawing", - escape_html(&entry.meta.drawing), - escape_html(&entry.meta.name) + "", + escape_html(&entry.meta.drawing) ) } else { String::new() @@ -547,7 +545,7 @@ mod tests { entry.meta.drawing = "2026-04-09-abc123.png".into(); let form = render_form(&config); let html = render_page(DEFAULT_TEMPLATE, &config, &[entry], &form); - assert!(html.contains(r#"Drawing by alice"#)); + assert!(html.contains(r#""#)); } #[test] @@ -559,7 +557,7 @@ mod tests { let form = render_form(&config); let html = render_page(DEFAULT_TEMPLATE, &config, &[entry], &form); // Drawing renders regardless - assert!(html.contains(r#"Drawing by alice"#)); + assert!(html.contains(r#""#)); // But body HTML is escaped assert!(html.contains("<script>")); }