From ca5db3c04b30bf682d088e86d5f1bb57689405d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maikol=20Sol=C3=ADs?= Date: Fri, 27 Aug 2021 14:53:23 -0600 Subject: [PATCH] Fix: (org-dblock-write:org-ql) remove cookies Fix #248 Giving this edge case (https://github.com/alphapapa/org-ql/pull/249#issuecomment-906765405) the use of `:title` could be not optimal. This commit uses a regexp to remove the cookie directly. --- org-ql-search.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/org-ql-search.el b/org-ql-search.el index 298ef31..8c48bac 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -285,9 +285,11 @@ 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 (car (org-element-property :title element)) + (org-make-link-string (replace-regexp-in-string "\[[[:digit:]]*/[[:digit:]]*\]\\|\[[[:digit:]]*\%\]" "" + (org-element-property :raw-value element)) (org-link-display-format - (car (org-element-property :title element)))))) + (replace-regexp-in-string "\[[[:digit:]]*/[[:digit:]]*\]\\|\[[[:digit:]]*\%\]" "" + (org-element-property :raw-value element)))))) (cons 'priority (lambda (element) (--when-let (org-element-property :priority element) (char-to-string it))))