From 0f83e6122e82496000d9790162561b5a6e73a811 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 3 Jan 2024 01:51:37 -0600 Subject: [PATCH] fix wikipedia extract sometimes showing '( ;' --- src/engines/answer/wikipedia.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/engines/answer/wikipedia.rs b/src/engines/answer/wikipedia.rs index 86de216..fc018be 100644 --- a/src/engines/answer/wikipedia.rs +++ b/src/engines/answer/wikipedia.rs @@ -74,7 +74,10 @@ pub fn parse_response(body: &str) -> eyre::Result { return Ok(EngineResponse::new()); } - let extract = extract.replace("( )", "").replace("()", ""); + let extract = extract + .replace("( ;", "(") + .replace("( )", "") + .replace("()", ""); let page_title = title.replace(' ', "_"); let page_url = format!("https://en.wikipedia.org/wiki/{page_title}");