mirror of
https://github.com/ankitects/anki.git
synced 2025-11-11 07:07:13 -05:00
Fix fields with \n being ignored when searching all fields w/o regex (#3943)
* add singleline flag to regex when searching all fields * update test
This commit is contained in:
parent
e861364092
commit
1e6c8b2006
1 changed files with 2 additions and 2 deletions
|
|
@ -555,7 +555,7 @@ impl SqlWriter<'_> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write_all_fields(&mut self, val: &str) {
|
fn write_all_fields(&mut self, val: &str) {
|
||||||
self.args.push(format!("(?i)^{}$", to_re(val)));
|
self.args.push(format!("(?is)^{}$", to_re(val)));
|
||||||
write!(self.sql, "regexp_fields(?{}, n.flds)", self.args.len()).unwrap();
|
write!(self.sql, "regexp_fields(?{}, n.flds)", self.args.len()).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1081,7 +1081,7 @@ mod test {
|
||||||
s(ctx, "*:te*st"),
|
s(ctx, "*:te*st"),
|
||||||
(
|
(
|
||||||
"(regexp_fields(?1, n.flds))".into(),
|
"(regexp_fields(?1, n.flds))".into(),
|
||||||
vec!["(?i)^te.*st$".into()]
|
vec!["(?is)^te.*st$".into()]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
// all field search with regex
|
// all field search with regex
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue