diff --git a/lisp/org-roam-review.el b/lisp/org-roam-review.el index 213b1fd..ffff402 100644 --- a/lisp/org-roam-review.el +++ b/lisp/org-roam-review.el @@ -330,16 +330,21 @@ When called with a `C-u' prefix arg, clear the current filter." str)) (cl-defun org-roam-review-insert-preview (node &optional (depth 0)) - (magit-insert-section preview (org-roam-preview-section) + (magit-insert-section section (org-roam-preview-section) (let* ((start (org-roam-node-point node)) (file (org-roam-node-file node)) - (content (org-roam-fontify-like-in-org-mode (org-roam-preview-get-contents file start)))) - (oset preview file file) - (oset preview point start) - (insert (org-roam-review-indent-string (if (string-blank-p (string-trim-left content)) - (propertize "(Empty)" 'font-lock-face 'font-lock-comment-face) - content) - depth)) + (preview (org-roam-fontify-like-in-org-mode (org-roam-preview-get-contents file start))) + (post-formatters + (append org-roam-preview-postprocess-functions + (list (lambda (content) + (org-roam-review-indent-string (if (string-blank-p (string-trim-left content)) + (propertize "(Empty)" 'font-lock-face 'font-lock-comment-face) + content) + depth))))) + (formatted-preview (seq-reduce (lambda (str fn) (funcall fn str)) post-formatters preview))) + (oset section file file) + (oset section point start) + (insert formatted-preview) (insert "\n\n")))) (defun org-roam-review--insert-node (node)