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.
This commit is contained in:
Maikol Solís 2021-08-27 14:53:23 -06:00 committed by GitHub
parent e0febbfd5c
commit ca5db3c04b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -285,9 +285,11 @@ For example, an org-ql dynamic block header could look like:
(list (cons 'todo (lambda (element) (list (cons 'todo (lambda (element)
(org-element-property :todo-keyword element))) (org-element-property :todo-keyword element)))
(cons 'heading (lambda (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 (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) (cons 'priority (lambda (element)
(--when-let (org-element-property :priority element) (--when-let (org-element-property :priority element)
(char-to-string it)))) (char-to-string it))))