(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

@ -1,5 +1,11 @@
# Changelog # Changelog
## 1.2.3 (TBD)
## Bugfixes
- [#1074](https://github.com/org-roam/org-roam/issues/1074) fix `org-roam--extract-links` to handle content boundaries
## 1.2.2 (06-10-2020) ## 1.2.2 (06-10-2020)
In this release we support fuzzy links of the form `[[roam:Title]]`, `[[roam:*Headline]]` and `[[roam:Title*Headline]]`. Completion for these fuzzy links is supported via `completion-at-point`. In this release we support fuzzy links of the form `[[roam:Title]]`, `[[roam:*Headline]]` and `[[roam:Title*Headline]]`. Completion for these fuzzy links is supported via `completion-at-point`.

View File

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