From 2f3011a46671c255838dc35e77e1ae66dc50b857 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Fri, 24 Apr 2015 17:18:55 +0200 Subject: [PATCH] shr: strip leading whitespace when expanding URLs * lisp/net/shr.el (shr-expand-url): Strip leading whitespace from URL. --- lisp/net/shr.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 9d88d1ff441..454332e55d0 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -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)) -- 2.39.2