Merge pull request #826 from abdnh/write-dupes-fix

Make dupe search operate on non-stripped text
This commit is contained in:
Damien Elmes 2020-11-16 11:43:33 +10:00 committed by GitHub
commit ed3583b6fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -500,9 +500,7 @@ class Editor:
self.web.eval("setBackgrounds(%s);" % json.dumps(cols)) self.web.eval("setBackgrounds(%s);" % json.dumps(cols))
def showDupes(self): def showDupes(self):
contents = html.escape( contents = self.note.fields[0].replace('"', r"\"")
stripHTMLMedia(self.note.fields[0]), quote=False
).replace('"', r"\"")
browser = aqt.dialogs.open("Browser", self.mw) browser = aqt.dialogs.open("Browser", self.mw)
browser.form.searchEdit.lineEdit().setText( browser.form.searchEdit.lineEdit().setText(
'"dupe:%s,%s"' % (self.note.model()["id"], contents) '"dupe:%s,%s"' % (self.note.model()["id"], contents)

View File

@ -432,7 +432,7 @@ impl SqlWriter<'_> {
ntid, csum ntid, csum
) )
.unwrap(); .unwrap();
self.args.push(text.to_string()); self.args.push(text_nohtml.to_string());
} }
fn write_added(&mut self, days: u32) -> Result<()> { fn write_added(&mut self, days: u32) -> Result<()> {