From 5282238901e2669ce4a596262ce60752412d4bcc Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 30 Mar 2024 22:37:12 -0500 Subject: [PATCH] fix wrapping for long results with no spaces --- src/web/assets/style.css | 1 + src/web/search.rs | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/web/assets/style.css b/src/web/assets/style.css index a18532d..41abd4a 100644 --- a/src/web/assets/style.css +++ b/src/web/assets/style.css @@ -13,6 +13,7 @@ body { /* enough space for the infobox */ max-width: 73.5rem; margin: 0 auto; + word-break: break-word; } main { max-width: 40rem; diff --git a/src/web/search.rs b/src/web/search.rs index 66413bd..93de319 100644 --- a/src/web/search.rs +++ b/src/web/search.rs @@ -102,7 +102,6 @@ fn render_results(response: Response) -> String { engines_html = render_engine_list(&[infobox.engine]) )); } - if let Some(answer) = &response.answer { html.push_str(&format!( r#"
{answer_html}{engines_html}
"#, @@ -111,7 +110,7 @@ fn render_results(response: Response) -> String { )); } if let Some(featured_snippet) = &response.featured_snippet { - html.push_str(&render_featured_snippet(&featured_snippet)); + html.push_str(&render_featured_snippet(featured_snippet)); } for result in &response.search_results { html.push_str(&render_search_result(result));