diff options
author | Andreas Schwab <schwab@linux-m68k.org> | 2021-12-23 19:06:13 +0100 |
---|---|---|
committer | Andreas Schwab <schwab@linux-m68k.org> | 2021-12-23 19:07:49 +0100 |
commit | edb1d491d968144c4b3a0d0efe0afc22448c4684 (patch) | |
tree | 119548095f5bd8604b734cb1d8e20ba076db9284 /lisp/net | |
parent | 29fffbdd87391272e9131be63cf93f5067d6ae0d (diff) | |
download | emacs-edb1d491d968144c4b3a0d0efe0afc22448c4684.tar.gz emacs-edb1d491d968144c4b3a0d0efe0afc22448c4684.tar.bz2 emacs-edb1d491d968144c4b3a0d0efe0afc22448c4684.zip |
* lisp/net/shr.el (shr-expand-url): Also strip trailing
whitespace.
Diffstat (limited to 'lisp/net')
-rw-r--r-- | lisp/net/shr.el | 4 |
1 files changed, 3 insertions, 1 deletions
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) |