(fix): fix org-roam--extract-links (#1179)

Co-authored-by: Boris Buliga <boris@d12frosted.io>
Co-authored-by: Gustav <gustav@whil.se>
This commit is contained in:
Jethro Kuan
2020-10-10 21:34:16 +08:00
committed by GitHub
parent e8d3516fa8
commit 82bd6c6cda
2 changed files with 11 additions and 6 deletions

View File

@ -586,14 +586,13 @@ it as FILE-PATH."
(let* ((type (org-roam--collate-types (org-element-property :type link)))
(path (org-element-property :path link))
(element (org-element-at-point))
(begin (or (org-element-property :content-begin element)
(begin (or (org-element-property :contents-begin element)
(org-element-property :begin element)))
(end (or (org-element-property :content-end element)
(org-element-property :end element)))
(content (or (org-element-property :raw-value element)
(buffer-substring-no-properties
begin
(or (org-element-property :content-end element)
(org-element-property :end element)))))
(content (string-trim content))
(when (and begin end)
(string-trim (buffer-substring-no-properties begin end)))))
(properties (list :outline (org-roam--get-outline-path)
:content content
:point begin))