From 7af8a5643455c5a50bba9e2a2b0d87302183b373 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Fri, 2 Jun 2023 10:29:12 +0530 Subject: [PATCH] Remove filename from reference before rendering references in khoj.el Fixes bug where actual reference heading in next line jumping out of references footnote section --- src/interface/emacs/khoj.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/interface/emacs/khoj.el b/src/interface/emacs/khoj.el index 2c2431d3..30e2a718 100644 --- a/src/interface/emacs/khoj.el +++ b/src/interface/emacs/khoj.el @@ -825,6 +825,10 @@ RECEIVE-DATE is the message receive date." (propertize (format "^{ [fn:%x]}" khoj--reference-count) 'help-echo reference) (thread-last reference + ;; remove filename top heading line from reference + ;; prevents actual reference heading in next line jumping out of references footnote section + (replace-regexp-in-string "^\* .*\n" "") + ;; remove multiple, consecutive empty lines from reference (replace-regexp-in-string "\n\n" "\n") (format "\n[fn:%x] %s" khoj--reference-count))))