mirror of
https://github.com/org-roam/org-roam
synced 2025-09-14 15:46:48 -05:00
Fix link extraction error when a file starts with blank lines (#1081)
org-element-at-point doesn't just determine the closest element -- if it's "within blank lines at the beginning of buffer", it returns nil. ;; Within blank lines at the beginning of buffer, return nil. ((bobp) nil) Skip whitespace at beginning of buffer to avoid this.
This commit is contained in:
@@ -586,7 +586,8 @@ it as FILE-PATH."
|
||||
(lambda (link)
|
||||
(let* ((type (org-element-property :type link))
|
||||
(path (org-element-property :path link))
|
||||
(element (org-element-at-point))
|
||||
(element (progn (org-skip-whitespace)
|
||||
(org-element-at-point)))
|
||||
(begin (or (org-element-property :content-begin element)
|
||||
(org-element-property :begin element)))
|
||||
(content (or (org-element-property :raw-value element)
|
||||
|
Reference in New Issue
Block a user