diff --git a/rslib/src/search/parser.rs b/rslib/src/search/parser.rs index 37ff504f8..54fb8c553 100644 --- a/rslib/src/search/parser.rs +++ b/rslib/src/search/parser.rs @@ -69,7 +69,7 @@ pub(super) enum SearchNode<'a> { AddedInDays(u32), EditedInDays(u32), CardTemplate(TemplateKind<'a>), - Deck(String), + Deck(Cow<'a, str>), DeckID(DeckID), NoteTypeID(NoteTypeID), NoteType(OptionalRe<'a>), @@ -280,7 +280,7 @@ fn search_node_for_text_with_argument<'a>( Ok(match key.to_ascii_lowercase().as_str() { "added" => SearchNode::AddedInDays(val.parse()?), "edited" => SearchNode::EditedInDays(val.parse()?), - "deck" => SearchNode::Deck(unescape_to_enforced_re(val)?), + "deck" => SearchNode::Deck(unescape_quotes(val)), "note" => SearchNode::NoteType(unescape_to_re(val)?), "tag" => SearchNode::Tag(parse_tag(val)?), "mid" => SearchNode::NoteTypeID(val.parse()?), diff --git a/rslib/src/search/sqlwriter.rs b/rslib/src/search/sqlwriter.rs index 9f17c555c..5ea422b04 100644 --- a/rslib/src/search/sqlwriter.rs +++ b/rslib/src/search/sqlwriter.rs @@ -319,6 +319,7 @@ impl SqlWriter<'_> { }; // convert to a regex that includes child decks + // fixme: use unescape_to_enforced_re from parser.rs? let re = text_to_re(&native_deck); self.args.push(format!("(?i)^{}($|\x1f)", re)); let arg_idx = self.args.len();