Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Hello,
>
> Chunyang Xu <m...@xuchunyang.me> writes:
>
>> I changed `org-plain-link-re' to make it not longer think "[" and "]"
>> are valid characters in a URL, which solves the problem.
>
> Thank you.
>
> I solved the problem differently, but your suggestion still makes sense.
> Would you mind making it a proper patch, using "git format-patch", with
> a proper commit message? Don't forget to add TINYCHANGE cookie at the
> end if you haven't signed papers yet.

Here is the patch.

>From c0b86176dc99f63385bcebc1ccbcb5d41f062a2c Mon Sep 17 00:00:00 2001
From: Chunyang Xu <m...@xuchunyang.me>
Date: Sun, 28 May 2017 12:10:58 +0800
Subject: [PATCH] Exclude '[' and ']' in `org-plain-link-re'

* lisp/org.el (org-make-link-regexps): Do it.

TINYCHANGE
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 102a9b265..c2818299e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5687,7 +5687,7 @@ This should be called after the variable `org-link-parameters' has changed."
 	  org-plain-link-re
 	  (concat
 	   "\\<" types-re ":"
-	   "\\([^ \t\n()<>]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] \t\n]\\|/\\)\\)\\)")
+	   "\\([^][ \t\n()<>]+\\(?:([[:word:]0-9_]+)\\|\\([^[:punct:] \t\n]\\|/\\)\\)\\)")
 	  ;;	 "\\([^]\t\n\r<>() ]+[^]\t\n\r<>,.;() ]\\)")
 	  org-bracket-link-regexp
 	  "\\[\\[\\([^][]+\\)\\]\\(\\[\\([^][]+\\)\\]\\)?\\]"
-- 
2.13.0

> Regards,
>
> -- 
> Nicolas Goaziou

Reply via email to