commit 69c57bd5199e18b38d29757fc27af6dca1b4876d parent 947ca223643d28e189480e607df68449c15786cb Author: 4shen0ne <4shen.01@gmail.com> Date: Sun, 8 May 2022 16:34:17 +0800 fix: delete formatted link Diffstat:
| M | org-download.el | | | 4 | +++- |
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/org-download.el b/org-download.el @@ -652,7 +652,9 @@ When TIMES isn't nil, delete only TIMES links." (save-excursion (goto-char beg) (while (and (>= (cl-decf times) 0) - (re-search-forward "\\[\\[file:\\([^]]*\\)\\]\\]" end t)) + (and (string-match "\\[\\[\\(\\w+\\)" org-download-link-format) + (let ((link-name (match-string 1 org-download-link-format))) + (re-search-forward (format "\\[\\[%s:\\([^]]*\\)\\]\\]" link-name) end t)))) (let ((str (match-string-no-properties 1))) (delete-region beg (match-end 0))