emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 2f3011a: shr: strip leading whitespace when expandi


From: Andreas Schwab
Subject: [Emacs-diffs] master 2f3011a: shr: strip leading whitespace when expanding URLs
Date: Fri, 24 Apr 2015 15:20:51 +0000

branch: master
commit 2f3011a46671c255838dc35e77e1ae66dc50b857
Author: Andreas Schwab <address@hidden>
Commit: Andreas Schwab <address@hidden>

    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 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 9d88d1f..454332e 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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]