From 7d41bd49bc22d457a2a84e360b3ab4dc22eb587a Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sun, 30 Apr 2023 16:18:30 +0200 Subject: [PATCH] org-odt-plain-text: Fix when text contains only spaces * lisp/ox-odt.el (org-odt-plain-text): Do not crash when input only consists of spacing. --- lisp/ox-odt.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el index 2ac34c8db..15c9037e9 100644 --- a/lisp/ox-odt.el +++ b/lisp/ox-odt.el @@ -2927,6 +2927,9 @@ (defun org-odt-plain-text (text info) (match-string 0 output))) (trailing (and (string-match (rx (1+ blank) eos) output) (match-string 0 output)))) + (when (length= leading (length output)) + (setq leading "") + (setq trailing "")) (insert (substring output -- 2.38.4