1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-02-01 20:06:00 +00:00

shr: strip leading whitespace when expanding URLs

* lisp/net/shr.el (shr-expand-url): Strip leading whitespace from URL.
This commit is contained in:
Andreas Schwab 2015-04-24 17:18:55 +02:00
parent 422f15d9d6
commit 2f3011a466

View File

@ -709,6 +709,9 @@ size, and full-buffer size."
shr-base))
(when (zerop (length url))
(setq url nil))
;; Strip leading whitespace
(and url (string-match "\\`\\s-+" url)
(setq url (substring url (match-end 0))))
(cond ((or (not url)
(not base)
(string-match "\\`[a-z]*:" url))