From c9e4e864c323a125d38ce7db7a821ee030318d3e Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 3 Jul 2024 02:25:00 +0000 Subject: [PATCH] fix notepad incorrectly triggering and having wrong html --- src/engines/answer/notepad.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/engines/answer/notepad.rs b/src/engines/answer/notepad.rs index 9f75a89..e80ffaa 100644 --- a/src/engines/answer/notepad.rs +++ b/src/engines/answer/notepad.rs @@ -5,7 +5,8 @@ use crate::engines::{EngineResponse, SearchQuery}; use super::regex; pub fn request(query: &SearchQuery) -> EngineResponse { - if !regex!("(note|text|code) ?(pad|book|edit(or|er)?)").is_match(&query.query.to_lowercase()) { + if !regex!("^(note|text|code) ?(pad|book|edit(or|er)?)$").is_match(&query.query.to_lowercase()) + { return EngineResponse::new(); } @@ -13,6 +14,6 @@ pub fn request(query: &SearchQuery) -> EngineResponse { // `contenteditable="plaintext-only"` attribute currently only works on Chrome. // This should be updated when the attribute becomes available in more browsers EngineResponse::answer_html(html! { - div."answer-notepad" contenteditable="plaintext-only" {} + div."answer-notepad" contenteditable {} }) }