mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -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 = []
|
to_fix = []
|
||||||
for id, tags in self.db.execute("select id, tags from notes"):
|
for id, tags in self.db.execute("select id, tags from notes"):
|
||||||
norm = unicodedata.normalize("NFC", tags)
|
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 + " "
|
norm = " " + norm + " "
|
||||||
if norm != tags:
|
if norm != tags:
|
||||||
to_fix.append((norm, self.usn(), intTime(), id))
|
to_fix.append((norm, self.usn(), intTime(), id))
|
||||||
|
|
Loading…
Reference in a new issue