mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 12:47:11 -05:00
Replace sequences of whitespace into single space in AddTags (#1840)
This commit is contained in:
parent
1ec227d926
commit
df1f7ff96c
1 changed files with 6 additions and 1 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
import re
|
||||||
from typing import Callable, Sequence
|
from typing import Callable, Sequence
|
||||||
|
|
||||||
import aqt
|
import aqt
|
||||||
|
|
@ -735,8 +736,12 @@ class Browser(QMainWindow):
|
||||||
"Shows prompt if tags not provided."
|
"Shows prompt if tags not provided."
|
||||||
if not (tags := tags or self._prompt_for_tags(tr.browsing_enter_tags_to_add())):
|
if not (tags := tags or self._prompt_for_tags(tr.browsing_enter_tags_to_add())):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
space_separated_tags = re.sub(r"[ \n\t\v]+", " ", tags)
|
||||||
add_tags_to_notes(
|
add_tags_to_notes(
|
||||||
parent=self, note_ids=self.selected_notes(), space_separated_tags=tags
|
parent=self,
|
||||||
|
note_ids=self.selected_notes(),
|
||||||
|
space_separated_tags=space_separated_tags,
|
||||||
).run_in_background(initiator=self)
|
).run_in_background(initiator=self)
|
||||||
|
|
||||||
@no_arg_trigger
|
@no_arg_trigger
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue