From mboxrd@z Thu Jan 1 00:00:00 1970 From: pierre.techoueyres@free.fr (Pierre =?utf-8?Q?T=C3=A9choueyres?=) Subject: Re: [PATCH] Possible bug in org-protocol Date: Sat, 09 Mar 2019 14:14:11 +0100 Message-ID: <878sxow5p8.fsf@killashandra.ballybran.fr> References: <87d0n29u8j.fsf@killashandra.ballybran.fr> <87sgvxkcq3.fsf@nicolasgoaziou.fr> <87sgvxw7em.fsf@killashandra.ballybran.fr> <87o96kl5hm.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:39614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2bns-0000R1-L9 for emacs-orgmode@gnu.org; Sat, 09 Mar 2019 08:14:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2bnr-00025T-Me for emacs-orgmode@gnu.org; Sat, 09 Mar 2019 08:14:16 -0500 Received: from smtp4-g21.free.fr ([2a01:e0c:1:1599::13]:6134) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h2bnr-00023O-CP for emacs-orgmode@gnu.org; Sat, 09 Mar 2019 08:14:15 -0500 Received: from killashandra.ballybran.fr.free.fr (unknown [IPv6:2a01:e0a:1e2:f8b0:9cc3:35bf:aa81:ccf7]) by smtp4-g21.free.fr (Postfix) with ESMTPS id DA0D819F591 for ; Sat, 9 Mar 2019 14:14:11 +0100 (CET) In-Reply-To: <87o96kl5hm.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Sat, 09 Mar 2019 11:14:13 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Nicolas, Nicolas Goaziou writes: > Hello, > > pierre.techoueyres@free.fr (Pierre T=C3=A9choueyres) writes: > >> I think so, as org-protocol, for what I've understood, is triggered by >> an URL where protocol is org-protocol. So the content of the URL itself >> must be encoded. > > OK. I applied you fix. Thank you. Thanks for your quick action. I've also written another test for this patch. Would you mind adding it too ? As a bonus it show the manual paragraph explaining the neccessity to encode the parts of url befor calling org-protocol. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=pte-org-protocol-unescape-tests.patch Content-Description: Test for org-protocol unescape diff --git a/testing/lisp/test-org-protocol.el b/testing/lisp/test-org-protocol.el index fc764386c..6ee368dcf 100644 --- a/testing/lisp/test-org-protocol.el +++ b/testing/lisp/test-org-protocol.el @@ -35,6 +35,16 @@ (let ((data (org-protocol-parse-parameters "url=abc&title=def" t))) (should (string= (plist-get data :url) "abc")) (should (string= (plist-get data :title) "def"))) + ;; Parse new-style complex links + (let* ((url (concat "template=p&" + "url=https%3A%2F%2Forgmode.org%2Forg.html%23capture-protocol&" + "title=The%20Org%20Manual&" + "body=9.4.2%20capture%20protocol")) + (data (org-protocol-parse-parameters url))) + (should (string= (plist-get data :template) "p")) + (should (string= (plist-get data :url) "https://orgmode.org/org.html#capture-protocol")) + (should (string= (plist-get data :title) "The Org Manual")) + (should (string= (plist-get data :body) "9.4.2 capture protocol"))) ;; Parse old-style links (let ((data (org-protocol-parse-parameters "abc/def" nil '(:url :title)))) (should (string= (plist-get data :url) "abc")) --=-=-= Content-Type: text/plain Regards, P.S. Is simple diffs an acceptable format for patches or should I send you an fully formatted git commit ? --=-=-=--