Merge pull request #750 from sobjornstad/unaddable-tag

Fix unanchored regex in bulk tag add routine
This commit is contained in:
Damien Elmes 2020-08-29 10:19:59 +10:00 committed by GitHub
commit f7928fe14f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -47,6 +47,7 @@ Alexander Presnyakov <flagist0@gmail.com>
abdo <github.com/ANH25>
aplaice <plaice.adam+github@gmail.com>
phwoo <github.com/phwoo>
Soren Bjornstad <anki@sorenbjornstad.com>
********************

View File

@ -152,7 +152,7 @@ impl Collection {
let matcher = regex::RegexSet::new(
tags.iter()
.map(|s| regex::escape(s))
.map(|s| format!("(?i){}", s)),
.map(|s| format!("(?i)^{}$", s)),
)
.map_err(|_| AnkiError::invalid_input("invalid regex"))?;