Simplify whitespace stripping in shr-expand-url

* lisp/net/shr.el (shr-expand-url): Simplify whitespace stripping.
This commit is contained in:
Lars Ingebrigtsen 2021-12-24 10:23:35 +01:00
parent 552b74ba9e
commit b9015606d1

View file

@ -857,11 +857,9 @@ size, and full-buffer size."
shr-base))
(when (zerop (length url))
(setq url nil))
;; 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))))
;; Strip leading/trailing whitespace.
(when url
(setq url (string-trim url)))
(cond ((zerop (length url))
(nth 3 base))
((or (not base)