From 358d0f957ee91aae7417b49570355d75790f910e Mon Sep 17 00:00:00 2001 From: abdo Date: Mon, 16 Nov 2020 04:01:04 +0300 Subject: [PATCH] Make dupe search operate on non-stripped text See https://github.com/ankitects/anki/pull/822/ --- qt/aqt/editor.py | 4 +--- rslib/src/search/sqlwriter.rs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/qt/aqt/editor.py b/qt/aqt/editor.py index 1add63905..d01238853 100644 --- a/qt/aqt/editor.py +++ b/qt/aqt/editor.py @@ -500,9 +500,7 @@ class Editor: self.web.eval("setBackgrounds(%s);" % json.dumps(cols)) def showDupes(self): - contents = html.escape( - stripHTMLMedia(self.note.fields[0]), quote=False - ).replace('"', r"\"") + contents = self.note.fields[0].replace('"', r"\"") browser = aqt.dialogs.open("Browser", self.mw) browser.form.searchEdit.lineEdit().setText( '"dupe:%s,%s"' % (self.note.model()["id"], contents) diff --git a/rslib/src/search/sqlwriter.rs b/rslib/src/search/sqlwriter.rs index 28a763ed3..b678bbd33 100644 --- a/rslib/src/search/sqlwriter.rs +++ b/rslib/src/search/sqlwriter.rs @@ -432,7 +432,7 @@ impl SqlWriter<'_> { ntid, csum ) .unwrap(); - self.args.push(text.to_string()); + self.args.push(text_nohtml.to_string()); } fn write_added(&mut self, days: u32) -> Result<()> {