]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/net/shr.el (shr-expand-url): Also strip trailing
authorAndreas Schwab <schwab@linux-m68k.org>
Thu, 23 Dec 2021 18:06:13 +0000 (19:06 +0100)
committerAndreas Schwab <schwab@linux-m68k.org>
Thu, 23 Dec 2021 18:07:49 +0000 (19:07 +0100)
whitespace.

lisp/net/shr.el

index 48590fd675a37f17fcfcab98aea296376a08a682..4a22091d59bcdb6003bb81d8ddf3e2fc269caa2a 100644 (file)
@@ -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)