summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-03-08 01:43:44 -0500
committerKyle Meyer <kyle@kyleam.com>2016-03-08 01:45:35 -0500
commit9872a32374189663808682a695cd0549ff37b54d (patch)
tree636a986be8fb514845c9af075367dc0316d15929
parent6c859cde38e8b3b5ff0702ff91e6b0005020357d (diff)
downloadorg-link-edit-9872a32374189663808682a695cd0549ff37b54d.tar.gz
org-link-edit--get-link-data: Unescape link text
org-make-link-string will escape the link again when it's reinserted.
-rw-r--r--org-link-edit.el4
-rw-r--r--test-org-link-edit.el8
2 files changed, 10 insertions, 2 deletions
diff --git a/org-link-edit.el b/org-link-edit.el
index 9e18629..4e94c09 100644
--- a/org-link-edit.el
+++ b/org-link-edit.el
@@ -84,14 +84,14 @@ The list includes
((looking-at org-bracket-link-regexp)
(list (match-beginning 0)
(match-end 0)
- (match-string-no-properties 1)
+ (org-link-unescape (match-string-no-properties 1))
(or (and (match-end 3)
(match-string-no-properties 3))
"")))
((looking-at org-plain-link-re)
(list (match-beginning 0)
(match-end 0)
- (match-string-no-properties 0)
+ (org-link-unescape (match-string-no-properties 0))
nil))
(t
(error "What am I looking at?"))))))
diff --git a/test-org-link-edit.el b/test-org-link-edit.el
index 19d8c97..fe8b4a5 100644
--- a/test-org-link-edit.el
+++ b/test-org-link-edit.el
@@ -447,6 +447,14 @@ website is"
(org-link-edit-backward-slurp 1)
(org-link-edit-backward-barf 1)
(buffer-string))))
+ ;; Handle escaped link components.
+ (should
+ (string= "Here is \[\[file:t.org::some%20text\]\[Org\]\] file"
+ (org-test-with-temp-text
+ "Here is <point>\[\[file:t.org::some%20text\]\[Org\]\] file"
+ (org-link-edit-forward-slurp 1)
+ (org-link-edit-forward-barf 1)
+ (buffer-string))))
;; Failed round trip because of newline.
(should
(string= "Here is \[\[http://orgmode.org/\]\[Org's\]\] website"