From 56444ab967fd33aeb4ab2796091683ecd8bbc15a Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 17 Nov 2017 16:20:33 +1000 Subject: [PATCH] don't check extension when localizing image sources fixes https://anki.tenderapp.com/discussions/beta-testing/916-pictures-not-showing-on-iphoneipad-ios11-when-not-connected-to-internet --- aqt/editor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aqt/editor.py b/aqt/editor.py index 44a96c184..d68905e33 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -607,6 +607,8 @@ to a cloze type first, via Edit>Change Note Type.""")) return finally: self.mw.progress.finish() + # strip off any query string + url = re.sub("\?.*?$", "", url) path = urllib.parse.unquote(url) return self.mw.col.media.writeData(path, filecontents) @@ -645,7 +647,7 @@ to a cloze type first, via Edit>Change Note Type.""")) else: # in external pastes, download remote media if self.isURL(src): - fname = self.urlToFile(src) + fname = self._retrieveURL(src) if fname: tag['src'] = fname