mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
normalize search text
https://anki.tenderapp.com/discussions/ankidesktop/30614-diacritics-changed-on-card-save-anki-21
This commit is contained in:
parent
fea23177e8
commit
d3c0ea46e2
1 changed files with 5 additions and 1 deletions
|
@ -6,6 +6,7 @@ import sre_constants
|
|||
import html
|
||||
import time
|
||||
import re
|
||||
import unicodedata
|
||||
from operator import itemgetter
|
||||
from anki.lang import ngettext
|
||||
import json
|
||||
|
@ -577,8 +578,11 @@ class Browser(QMainWindow):
|
|||
if self.form.searchEdit.lineEdit().text() == self._searchPrompt:
|
||||
self.form.searchEdit.lineEdit().setText("deck:current ")
|
||||
|
||||
# grab search text and normalize
|
||||
txt = self.form.searchEdit.lineEdit().text()
|
||||
txt = unicodedata.normalize("NFC", txt)
|
||||
|
||||
# update history
|
||||
txt = str(self.form.searchEdit.lineEdit().text())
|
||||
sh = self.mw.pm.profile['searchHistory']
|
||||
if txt in sh:
|
||||
sh.remove(txt)
|
||||
|
|
Loading…
Reference in a new issue