aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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"