From: Andreas Schwab Date: Thu, 23 Dec 2021 18:06:13 +0000 (+0100) Subject: * lisp/net/shr.el (shr-expand-url): Also strip trailing X-Git-Tag: emacs-28.0.91~35 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=edb1d491d968144c4b3a0d0efe0afc22448c4684;p=emacs.git * lisp/net/shr.el (shr-expand-url): Also strip trailing whitespace. --- diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 48590fd675a..4a22091d59b 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -941,9 +941,11 @@ size, and full-buffer size." shr-base)) (when (zerop (length url)) (setq url nil)) - ;; Strip leading whitespace + ;; Strip leading/trailing whitespace (and url (string-match "\\`\\s-+" url) (setq url (substring url (match-end 0)))) + (and url (string-match "\\s-+\\'" url) + (setq url (substring url 0 (match-beginning 0)))) (cond ((zerop (length url)) (nth 3 base)) ((or (not base)