From eaa27ca841d57271b4ea9fb50f5774f6871b0215 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Mon, 12 Feb 2024 10:14:37 +0530 Subject: [PATCH] Only add spaces after heading if any tags in orgnode raw entry repr --- src/khoj/processor/content/org_mode/orgnode.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/khoj/processor/content/org_mode/orgnode.py b/src/khoj/processor/content/org_mode/orgnode.py index 63d36b70..8449cc9d 100644 --- a/src/khoj/processor/content/org_mode/orgnode.py +++ b/src/khoj/processor/content/org_mode/orgnode.py @@ -495,12 +495,13 @@ class Orgnode(object): if self._priority: n = n + "[#" + self._priority + "] " n = n + self._heading - n = "%-60s " % n # hack - tags will start in column 62 - closecolon = "" - for t in self._tags: - n = n + ":" + t - closecolon = ":" - n = n + closecolon + if self._tags: + n = "%-60s " % n # hack - tags will start in column 62 + closecolon = "" + for t in self._tags: + n = n + ":" + t + closecolon = ":" + n = n + closecolon n = n + "\n" # Get body indentation from first line of body