From: Lars Ingebrigtsen Date: Mon, 11 Jun 2018 18:38:25 +0000 (+0200) Subject: Don't have shr bug out on degenerate tags X-Git-Tag: emacs-27.0.90~4882 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=94d60f59fc654706c3a52ed2c90c355b36be7898;p=emacs.git Don't have shr bug out on degenerate tags * lisp/net/shr.el (shr-tag-img): Protect against contructs like . --- diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 1103a930242..edea7cb297c 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1560,6 +1560,10 @@ The preference is a float determined from `shr-prefer-media-type'." (when (zerop (length alt)) (setq alt "*")) (cond + ((null url) + ;; After further expansion, there turned out to be no valid + ;; src in the img after all. + ) ((or (member (dom-attr dom 'height) '("0" "1")) (member (dom-attr dom 'width) '("0" "1"))) ;; Ignore zero-sized or single-pixel images.