From 98a866c2cb3ce379d6104e405dce542f001e430f Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 2 Sep 2019 10:17:04 +1000 Subject: [PATCH] support multiple urls at once in editor --- aqt/editor.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/aqt/editor.py b/aqt/editor.py index ca9abc986..a190febf8 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -909,10 +909,14 @@ class EditorWebView(AnkiWebView): if not mime.hasUrls(): return - url = mime.urls()[0].toString() - # chrome likes to give us the URL twice with a \n - url = url.splitlines()[0] - return self.editor.urlToLink(url) + buf = "" + for url in mime.urls(): + url = url.toString() + # chrome likes to give us the URL twice with a \n + url = url.splitlines()[0] + buf += self.editor.urlToLink(url) or "" + + return buf def _processText(self, mime): if not mime.hasText():