Do not output headlines without backlinks in dynamic blocks
This commit is contained in:
parent
99dbd00e71
commit
c572451c14
|
@ -1046,6 +1046,7 @@ PARAMS may contain the following values:
|
|||
;; Formatting.
|
||||
(insert (format "| Item | Backlinks | Priority |\n|---|"))
|
||||
(dolist (headline headlines)
|
||||
(when (cdr headline) ; do not print backlinks if there are none
|
||||
(insert (format "\n| %s |\n|---|" (db/org--format-link-with-headline (car headline))))
|
||||
(let ((backlink-lines (-> (mapcar #'(lambda (backlink-id)
|
||||
(list (db/org--format-link-with-headline backlink-id)
|
||||
|
@ -1055,7 +1056,6 @@ PARAMS may contain the following values:
|
|||
(cl-sort #'string< :key #'cl-second))))
|
||||
(dolist (line backlink-lines)
|
||||
(insert (apply #'format "\n| | %s | %s |" line)))
|
||||
(when backlink-lines ; only print closing hline when there's something to close
|
||||
(insert "\n|---|"))))
|
||||
(org-table-align)))
|
||||
|
||||
|
|
Loading…
Reference in New Issue