mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
fix unnecessary spaces being added to notes with empty tags
This commit is contained in:
parent
5236e20a7a
commit
9bb4a02e0a
1 changed files with 3 additions and 1 deletions
|
@ -1010,7 +1010,9 @@ and type=0""",
|
|||
to_fix = []
|
||||
for id, tags in self.db.execute("select id, tags from notes"):
|
||||
norm = unicodedata.normalize("NFC", tags)
|
||||
if not norm.startswith(" ") or not norm.endswith(" "):
|
||||
if not norm.strip():
|
||||
norm = ""
|
||||
elif not norm.startswith(" ") or not norm.endswith(" "):
|
||||
norm = " " + norm + " "
|
||||
if norm != tags:
|
||||
to_fix.append((norm, self.usn(), intTime(), id))
|
||||
|
|
Loading…
Reference in a new issue