fix notepad incorrectly triggering and having wrong html

This commit is contained in:
mat 2024-07-03 02:25:00 +00:00
parent feceb9aa99
commit c9e4e864c3

View File

@ -5,7 +5,8 @@ use crate::engines::{EngineResponse, SearchQuery};
use super::regex; use super::regex;
pub fn request(query: &SearchQuery) -> EngineResponse { 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(); return EngineResponse::new();
} }
@ -13,6 +14,6 @@ pub fn request(query: &SearchQuery) -> EngineResponse {
// `contenteditable="plaintext-only"` attribute currently only works on Chrome. // `contenteditable="plaintext-only"` attribute currently only works on Chrome.
// This should be updated when the attribute becomes available in more browsers // This should be updated when the attribute becomes available in more browsers
EngineResponse::answer_html(html! { EngineResponse::answer_html(html! {
div."answer-notepad" contenteditable="plaintext-only" {} div."answer-notepad" contenteditable {}
}) })
} }