if there's no html and we have an image, use that (#915)

This commit is contained in:
Damien Elmes 2013-07-11 17:43:11 +09:00
parent e2d2b759a4
commit 3007d884b8

View file

@ -1123,6 +1123,8 @@ class EditorWebView(AnkiWebView):
for url in self.editor.mw.col.media.filesInStr( for url in self.editor.mw.col.media.filesInStr(
mid, html, includeRemote=True): mid, html, includeRemote=True):
newHtml += self.editor.urlToLink(url) newHtml += self.editor.urlToLink(url)
if not newHtml and mime.hasImage():
return self._processImage(mime)
newMime.setHtml(newHtml) newMime.setHtml(newHtml)
else: else:
# use .text() if available so newlines are preserved; otherwise strip # use .text() if available so newlines are preserved; otherwise strip