From 0a4aa6bd207fd76f715e9562529d9fbec80ecd4e Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen <larsi@gnus.org> Date: Mon, 25 Aug 2014 17:59:38 +0200 Subject: [PATCH] shr.el: Encode copied URLs * net/shr.el (shr-copy-url): Encode copied URL to avoid getting URLs containing spaces and the like. --- lisp/ChangeLog | 5 +++++ lisp/net/shr.el | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7588427dd83..65a59f4da6d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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). diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 5e2e1eadf86..dae72b682b0 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -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." -- 2.39.5