support multiple urls at once in editor

This commit is contained in:
Damien Elmes 2019-09-02 10:17:04 +10:00
parent 35964fa55c
commit 98a866c2cb

View File

@ -909,10 +909,14 @@ class EditorWebView(AnkiWebView):
if not mime.hasUrls(): if not mime.hasUrls():
return return
url = mime.urls()[0].toString() buf = ""
# chrome likes to give us the URL twice with a \n for url in mime.urls():
url = url.splitlines()[0] url = url.toString()
return self.editor.urlToLink(url) # 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): def _processText(self, mime):
if not mime.hasText(): if not mime.hasText():