Browse Source

ol: Allow [[\\\\]] links

* lisp/ol.el (org-link-make-regexps): Allow [[\\\\]] links.
Nicolas Goaziou 5 years ago
parent
commit
f3474724ad
1 changed files with 4 additions and 3 deletions
  1. 4 3
      lisp/ol.el

+ 4 - 3
lisp/ol.el

@@ -714,11 +714,12 @@ This should be called after the variable `org-link-parameters' has changed."
 	  (rx (seq "[["
 	  (rx (seq "[["
 		   ;; URI part: match group 1.
 		   ;; URI part: match group 1.
 		   (group
 		   (group
-		    (*? anything)
 		    ;; Allow an even number of backslashes right
 		    ;; Allow an even number of backslashes right
 		    ;; before the closing bracket.
 		    ;; before the closing bracket.
-		    (not (any "\\"))
-		    (zero-or-more "\\\\"))
+		    (or (one-or-more "\\\\")
+			(and (*? anything)
+			     (not (any "\\"))
+			     (zero-or-more "\\\\"))))
 		   "]"
 		   "]"
 		   ;; Description (optional): match group 2.
 		   ;; Description (optional): match group 2.
 		   (opt "[" (group (+? anything)) "]")
 		   (opt "[" (group (+? anything)) "]")