mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
clear_tag() should be case-insensitive
This commit is contained in:
parent
dbd0334f97
commit
0ac97cf358
2 changed files with 2 additions and 2 deletions
|
@ -68,7 +68,7 @@ impl SqliteStorage {
|
||||||
pub(crate) fn clear_tag(&self, tag: &str) -> Result<()> {
|
pub(crate) fn clear_tag(&self, tag: &str) -> Result<()> {
|
||||||
self.db
|
self.db
|
||||||
.prepare_cached("delete from tags where tag regexp ?")?
|
.prepare_cached("delete from tags where tag regexp ?")?
|
||||||
.execute(&[format!("^{}($|::)", regex::escape(tag))])?;
|
.execute(&[format!("(?i)^{}($|::)", regex::escape(tag))])?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -435,7 +435,7 @@ mod test {
|
||||||
|
|
||||||
// tag children are also cleared when clearing their parent
|
// tag children are also cleared when clearing their parent
|
||||||
col.storage.clear_tags()?;
|
col.storage.clear_tags()?;
|
||||||
for name in vec!["a", "a::b", "a::b::c"] {
|
for name in vec!["a", "a::b", "A::b::c"] {
|
||||||
col.register_tag(Tag::new(name.to_string(), Usn(0)))?;
|
col.register_tag(Tag::new(name.to_string(), Usn(0)))?;
|
||||||
}
|
}
|
||||||
col.storage.clear_tag("a")?;
|
col.storage.clear_tag("a")?;
|
||||||
|
|
Loading…
Reference in a new issue