From 426eff4cffbc38dfc3b726ca76a2934fcbea2aea Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 10 Jun 2013 16:04:58 +0900 Subject: [PATCH] prioritize images over html for now when a user copies an image from the browser to the clipboard, we need to do this so the image pastes, as we currently don't support images derived from html pastes (issue 92) --- aqt/editor.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/aqt/editor.py b/aqt/editor.py index 9c9f226b4..55b46584c 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -1071,10 +1071,13 @@ class EditorWebView(AnkiWebView): return self._processUrls(mime) elif mime.hasText() and (self.strip or not mime.hasHtml()): return self._processText(mime) - elif mime.hasHtml(): - return self._processHtml(mime) + # we currently aren't able to extract images from html, so we prioritize + # images over html in cases where we have both. this is a hack until + # issue 92 is implemented elif mime.hasImage(): return self._processImage(mime) + elif mime.hasHtml(): + return self._processHtml(mime) else: # nothing return QMimeData()