From 1e4cabf98a8d27465dbb05191226ea1086cbd9b8 Mon Sep 17 00:00:00 2001 From: Omar Polo Date: Wed, 11 Aug 2021 07:57:46 +0000 Subject: [PATCH] don't leave # when there isn't a title and while there ensure that there's an empty line following the document title. Signed-off-by: Justin Abrahms --- ox-gemini.el | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/ox-gemini.el b/ox-gemini.el index 7329e0d..381159f 100644 --- a/ox-gemini.el +++ b/ox-gemini.el @@ -29,7 +29,6 @@ ;; TODO: ;; Sublists aren't supported in gemini ;; There's a trailing space after inline code samples -;; If you don't have a title, it leaves a blank # in the gmi ;; If you link a file to an absolute path, the links break ;; bare links don't work (e.g. directly linking https://google.com ;; @@ -207,14 +206,13 @@ holding contextual information." "Return complete document string after GEMINI conversion. CONTENTS is the transcoded contents string. INFO is a plist holding export options." - (concat - ;; Build title block. - (format "# %s\n" (org-export-data - (when (plist-get info :with-title) (plist-get info :title)) info)) - ;; Document's body. - contents)) - - + (let ((title (org-export-data (when (plist-get info :with-title) + (plist-get info :title)) + info))) + (concat + (unless (string= title "") + (format "# %s\n\n" title)) + contents))) (defun org-gemini-export-to-buffer (&optional async subtreep visible-only body-only ext-plist) "Export an org file to a new buffer.