Fix imports of decks with file paths using special URL characters (#3377)

This commit is contained in:
Themis Demetriades 2024-08-29 11:19:27 +01:00 committed by GitHub
parent b35b69a2d3
commit 0f44796b36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -187,7 +187,8 @@ Christian Donat <https://github.com/cdonat2>
Asuka Minato <https://asukaminato.eu.org>
Dillon Baldwin <https://github.com/DillBal>
Voczi <https://github.com/voczi>
Ben Nguyen <105088397+bpnguyen107@users.noreply.github.com>
Ben Nguyen <105088397+bpnguyen107@users.noreply.github.com>
Themis Demetriades <themis100@outlook.com>
********************
The text of the 3 clause BSD license follows:

View file

@ -5,6 +5,7 @@ from __future__ import annotations
import json
from dataclasses import dataclass
from urllib.parse import quote
import aqt
import aqt.deckconf
@ -65,7 +66,7 @@ class ImportDialog(QDialog):
self.web = AnkiWebView(kind=self.args.kind)
self.web.setVisible(False)
self.web.load_sveltekit_page(f"{self.args.ts_page}/{self.args.path}")
self.web.load_sveltekit_page(f"{self.args.ts_page}/{quote(self.args.path)}")
layout = QVBoxLayout()
layout.setContentsMargins(0, 0, 0, 0)
layout.addWidget(self.web)