]> git.eshelyaron.com Git - emacs.git/commitdiff
shr.el: Encode copied URLs
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 25 Aug 2014 15:59:38 +0000 (17:59 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 25 Aug 2014 15:59:38 +0000 (17:59 +0200)
* net/shr.el (shr-copy-url): Encode copied URL to avoid getting
URLs containing spaces and the like.

lisp/ChangeLog
lisp/net/shr.el

index 7588427dd830f3b90daff3a1165845bd52587b94..65a59f4da6d33867721478c88748402ff1028a7d 100644 (file)
@@ -1,3 +1,8 @@
+2014-08-25  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * net/shr.el (shr-copy-url): Encode copied URL to avoid getting
+       URLs containing spaces and the like.
+
 2014-08-25  Christoph Scholtes  <cschol2112@gmail.com>
 
        * subr.el (remq): Fix docstring (Bug#18253).
index 5e2e1eadf862c3825f7a2ed89cc12a49f94595ab..dae72b682b019aba006b208b222e4d6748d90ce8 100644 (file)
@@ -246,9 +246,9 @@ redirects somewhere else."
      ;; Copy the URL to the kill ring.
      (t
       (with-temp-buffer
-       (insert url)
+       (insert (url-encode-url url))
        (copy-region-as-kill (point-min) (point-max))
-       (message "Copied %s" url))))))
+       (message "Copied %s" (buffer-substring)))))))
 
 (defun shr-next-link ()
   "Skip to the next link."