aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schwab2015-04-24 17:18:55 +0200
committerAndreas Schwab2015-04-24 17:19:31 +0200
commit2f3011a46671c255838dc35e77e1ae66dc50b857 (patch)
tree9f88a1654d64b8090039f6af75c7dd24b7807f68
parent422f15d9d66c9f1907b3efb824f1e7f614ba9963 (diff)
downloademacs-2f3011a46671c255838dc35e77e1ae66dc50b857.tar.gz
emacs-2f3011a46671c255838dc35e77e1ae66dc50b857.zip
shr: strip leading whitespace when expanding URLs
* lisp/net/shr.el (shr-expand-url): Strip leading whitespace from URL.
-rw-r--r--lisp/net/shr.el3
1 files changed, 3 insertions, 0 deletions
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."
709 shr-base)) 709 shr-base))
710 (when (zerop (length url)) 710 (when (zerop (length url))
711 (setq url nil)) 711 (setq url nil))
712 ;; Strip leading whitespace
713 (and url (string-match "\\`\\s-+" url)
714 (setq url (substring url (match-end 0))))
712 (cond ((or (not url) 715 (cond ((or (not url)
713 (not base) 716 (not base)
714 (string-match "\\`[a-z]*:" url)) 717 (string-match "\\`[a-z]*:" url))