aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nov.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/nov.el b/nov.el
index ae17b07..31287e4 100644
--- a/nov.el
+++ b/nov.el
@@ -429,16 +429,16 @@ This function honors `shr-max-image-proportion' if possible."
(defvar nov-original-shr-tag-img-function
(symbol-function 'shr-tag-img))
-(defun nov-render-img (dom)
+(defun nov-render-img (dom &optional url)
"Custom <img> rendering function for DOM.
Uses `shr-tag-img' for external paths and `nov-insert-image' for
internal ones."
- (let ((url (cdr (assq 'src (cadr dom)))))
+ (let ((url (or url (cdr (assq 'src (cadr dom))))))
(if (nov-external-url-p url)
;; HACK: avoid hanging in an infinite loop when using
;; `cl-letf' to override `shr-tag-img' with a function that
;; might call `shr-tag-img' again
- (funcall nov-original-shr-tag-img-function dom)
+ (funcall nov-original-shr-tag-img-function dom url)
(setq url (expand-file-name url))
(nov-insert-image url))))