mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Escape deck characters as necessary in suggested deck export path
This commit is contained in:
parent
9707786eea
commit
58ee373a4f
1 changed files with 6 additions and 0 deletions
|
@ -2,6 +2,8 @@
|
|||
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||
|
||||
import os
|
||||
import re
|
||||
|
||||
from aqt.qt import *
|
||||
import aqt
|
||||
from aqt.utils import getSaveFile, tooltip, showWarning, askUser, \
|
||||
|
@ -66,7 +68,11 @@ class ExportDialog(QDialog):
|
|||
return
|
||||
else:
|
||||
verbatim = False
|
||||
|
||||
# Get deck name and remove invalid filename characters
|
||||
deck_name = self.decks[self.frm.deck.currentIndex()]
|
||||
deck_name = re.sub('[/?<>\:*|"^]', '_', deck_name)
|
||||
|
||||
filename = os.path.join(aqt.mw.pm.base,
|
||||
'{}.apkg'.format(deck_name))
|
||||
|
||||
|
|
Loading…
Reference in a new issue