[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [PATCH] Possible bug in org-protocol
From: |
Pierre Téchoueyres |
Subject: |
Re: [O] [PATCH] Possible bug in org-protocol |
Date: |
Sun, 10 Mar 2019 17:57:26 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (gnu/linux) |
Hello Nicolas,
Nicolas Goaziou <address@hidden> writes:
> ...
>> Is simple diffs an acceptable format for patches or should I send you an
>> fully formatted git commit ?
>
> The latter, please.
>
> Could you send a complete version of the patch?
What dou you think of the attached one ?
Regards,
Pierre
>From 92db52eb3e546ed03f0ade483a6cb149300ca6c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pierre=20T=C3=A9choueyres?= <address@hidden>
Date: Sun, 10 Mar 2019 17:50:22 +0100
Subject: [PATCH] org-protocol: Fix URL handling -- add tests
* testing/lisp/test-org-protocol.el
(test-org-protocol/org-protocol-parse-parameters):
add test for the commit e0bfdec22 which un-escape extracted link as
it is url-encoded externally.
---
testing/lisp/test-org-protocol.el | 10 ++++++++++
1 file changed, 10 insertions(+)
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"))
--
2.20.1