瀏覽代碼

Quote any special characters in org-make-target-link-regexp

* lisp/org.el (org-make-target-link-regexp): regexp-quote target
before replacing whitespace.

Previously a radio link <<<...>>> would match all three-letter words
in the buffer.  The manual indicates the radio links are meant to
match literally (modulo whitespace differences), so we should
regexp-quote all the targets to avoid over-eager matching.
Lawrence Mitchell 14 年之前
父節點
當前提交
32be74e098
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      lisp/org.el

+ 1 - 0
lisp/org.el

@@ -5424,6 +5424,7 @@ between words."
 	"\\<\\("
 	(mapconcat
 	 (lambda (x)
+	   (setq x (regexp-quote x))
 	   (while (string-match " +" x)
 	     (setq x (replace-match "\\s-+" t t x)))
 	   x)