[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 1e11f6f 1/2: Handle gracefully href="" in base tags in shr
From: |
Lars Ingebrigtsen |
Subject: |
master 1e11f6f 1/2: Handle gracefully href="" in base tags in shr |
Date: |
Wed, 23 Dec 2020 00:58:24 -0500 (EST) |
branch: master
commit 1e11f6f59d141f280b50905238a392faffdb134a
Author: Ćukasz Stelmach <stlman@poczta.fm>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Handle gracefully href="" in base tags in shr
* net/shr.el (shr-tag-base): shr-parse-base can't handle empty
strings gracefully. Don't call it unless href is a non-empty
string (bug#45355).
---
lisp/net/shr.el | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 2e5dd5f..1648e56 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -1516,8 +1516,9 @@ ones, in case fg and bg are nil."
plist)))
(defun shr-tag-base (dom)
- (when-let* ((base (dom-attr dom 'href)))
- (setq shr-base (shr-parse-base base)))
+ (let ((base (dom-attr dom 'href)))
+ (when (> (length base) 0)
+ (setq shr-base (shr-parse-base base))))
(shr-generic dom))
(defun shr-tag-a (dom)