From e0febbfd5c285ca72d9989224a22dce674e6bd8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maikol=20Sol=C3=ADs?= Date: Wed, 25 Aug 2021 12:44:17 -0600 Subject: [PATCH] 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 `[%]`). --- org-ql-search.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org-ql-search.el b/org-ql-search.el index c7c979f..298ef31 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -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))))