Fix: (org-dblock-write:org-ql) Use :title instead of :raw-value in headings

Fixes #248 

Uses `:title` instead of `raw-value` combined with a `car` to capture only the title of the heading. 
Now the links are properly formed even if there exist cookies (`[/]` or `[%]`).
This commit is contained in:
Maikol Solís 2021-08-25 12:44:17 -06:00 committed by GitHub
parent 94f9e6f303
commit e0febbfd5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -285,9 +285,9 @@ For example, an org-ql dynamic block header could look like:
(list (cons 'todo (lambda (element)
(org-element-property :todo-keyword element)))
(cons 'heading (lambda (element)
(org-make-link-string (org-element-property :raw-value element)
(org-make-link-string (car (org-element-property :title element))
(org-link-display-format
(org-element-property :raw-value element)))))
(car (org-element-property :title element))))))
(cons 'priority (lambda (element)
(--when-let (org-element-property :priority element)
(char-to-string it))))