diff --git a/src/engines/answer.rs b/src/engines/answer.rs index 501e092..b4b998b 100644 --- a/src/engines/answer.rs +++ b/src/engines/answer.rs @@ -1,6 +1,7 @@ pub mod calc; pub mod dictionary; pub mod ip; +pub mod thesaurus; pub mod timezone; pub mod useragent; pub mod wikipedia; diff --git a/src/engines/answer/calc.rs b/src/engines/answer/calc.rs index dbd9987..2709d27 100644 --- a/src/engines/answer/calc.rs +++ b/src/engines/answer/calc.rs @@ -17,7 +17,7 @@ pub fn request(query: &str) -> EngineResponse { EngineResponse::answer_html(format!( r#"
{query} =
Current time in {timezone}
{source_time} {source_timezone} to {target_timezone}
{extract}
"#, page_url = html_escape::encode_quoted_attribute(&page_url), - title = html_escape::encode_text(title), - extract = html_escape::encode_text(&extract), + title = html_escape::encode_safe(title), + extract = html_escape::encode_safe(&extract), ))) } diff --git a/src/engines/mod.rs b/src/engines/mod.rs index ac0a6ed..864a6ee 100644 --- a/src/engines/mod.rs +++ b/src/engines/mod.rs @@ -34,6 +34,7 @@ engines! { Calc = "calc", Wikipedia = "wikipedia", Dictionary = "dictionary", + Thesaurus = "thesaurus", Timezone = "timezone", // post-search StackExchange = "stackexchange", @@ -61,6 +62,7 @@ engine_requests! { Calc => answer::calc::request, None, Wikipedia => answer::wikipedia::request, parse_response, Dictionary => answer::dictionary::request, parse_response, + Thesaurus => answer::thesaurus::request, parse_response, Timezone => answer::timezone::request, None, } diff --git a/src/engines/postsearch/docs_rs.rs b/src/engines/postsearch/docs_rs.rs index 34d41f1..f9ce134 100644 --- a/src/engines/postsearch/docs_rs.rs +++ b/src/engines/postsearch/docs_rs.rs @@ -57,14 +57,14 @@ pub fn parse_response(HttpResponse { res, body }: &HttpResponse) -> Option