Keep headline around links when linking to them
So far, when a link is discovered in a headline, we only keep the description of that link. This will throw away the context of that link, which is undesirable. So let's keep it.
This commit is contained in:
parent
268ddeb1aa
commit
7960f763f4
|
@ -739,8 +739,11 @@ link."
|
||||||
;; use the link part
|
;; use the link part
|
||||||
(save-match-data
|
(save-match-data
|
||||||
(when (string-match org-link-bracket-re item)
|
(when (string-match org-link-bracket-re item)
|
||||||
(setq item (or (match-string-no-properties 2 item)
|
(let ((desc (or (match-string-no-properties 2 item)
|
||||||
(match-string-no-properties 1 item)))))
|
(match-string-no-properties 1 item))))
|
||||||
|
(setq item (concat (substring item 0 (match-beginning 0))
|
||||||
|
desc
|
||||||
|
(substring item (match-end 0)))))))
|
||||||
|
|
||||||
(org-insert-link nil (format "id:%s" id) item)))
|
(org-insert-link nil (format "id:%s" id) item)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue