[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 94d60f5: Don't have shr bug out on degenerate <img>
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master 94d60f5: Don't have shr bug out on degenerate <img> tags |
Date: |
Mon, 11 Jun 2018 14:38:58 -0400 (EDT) |
branch: master
commit 94d60f59fc654706c3a52ed2c90c355b36be7898
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Don't have shr bug out on degenerate <img> tags
* lisp/net/shr.el (shr-tag-img): Protect against contructs like
<img src=" ">.
---
lisp/net/shr.el | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 1103a93..edea7cb 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.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 94d60f5: Don't have shr bug out on degenerate <img> tags,
Lars Ingebrigtsen <=