From 3007d884b8f66519afb22dd8ac45ae7e925da936 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 11 Jul 2013 17:43:11 +0900 Subject: [PATCH] if there's no html and we have an image, use that (#915) --- aqt/editor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aqt/editor.py b/aqt/editor.py index a81857ca9..5b6ee83de 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -1123,6 +1123,8 @@ class EditorWebView(AnkiWebView): for url in self.editor.mw.col.media.filesInStr( mid, html, includeRemote=True): newHtml += self.editor.urlToLink(url) + if not newHtml and mime.hasImage(): + return self._processImage(mime) newMime.setHtml(newHtml) else: # use .text() if available so newlines are preserved; otherwise strip