From 491b8ea63fdf049dae122a0bc905e0eac3c7451f Mon Sep 17 00:00:00 2001 From: luoliyan Date: Tue, 28 Feb 2017 08:10:43 +0930 Subject: [PATCH] Allow special characters to be escaped --- anki/find.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/anki/find.py b/anki/find.py index 852a98230..b86319840 100644 --- a/anki/find.py +++ b/anki/find.py @@ -246,10 +246,10 @@ select distinct(n.id) from cards c, notes n where c.nid=n.id and """+preds val = val.replace("*", "%") if not val.startswith("%"): val = "% " + val - if not val.endswith("%"): + if not val.endswith("%") or val.endswith('\\%'): val += " %" args.append(val) - return "n.tags like ?" + return "n.tags like ? escape '\\'" def _findCardState(self, args): (val, args) = args