From 0899a9079edf4f1f12865661a043af7f393cd61a Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Wed, 12 May 2021 18:29:34 +0200 Subject: [PATCH] Clean up all links in headline when linking to it So far, we only considered one link in a headline and replaced it with its description when linking to it. When there are multiple links, this will fail. This commit changes this by iterating over all links in the headline, not only the first one. --- site-lisp/db-org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site-lisp/db-org.el b/site-lisp/db-org.el index 057d70e..ea5f7af 100644 --- a/site-lisp/db-org.el +++ b/site-lisp/db-org.el @@ -738,7 +738,7 @@ link." ;; When item is a link, only use it's description when available; otherwise ;; use the link part (save-match-data - (when (string-match org-link-bracket-re item) + (while (string-match org-link-bracket-re item) (let ((desc (or (match-string-no-properties 2 item) (match-string-no-properties 1 item)))) (setq item (concat (substring item 0 (match-beginning 0))