emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[BUG] [PATCH] org-odt-plain-text: Fix when text contains only spaces [9.


From: Damien Cassou
Subject: [BUG] [PATCH] org-odt-plain-text: Fix when text contains only spaces [9.7-pre (release_9.6.4-346-g7d41bd @ /home/cassou/.emacs.d/lib/org/lisp/)]
Date: Sun, 30 Apr 2023 16:30:41 +0200

Hi,

in [1], Ihor fixed a bug I reported in ox-odt. Unfortunately, this fix
broke figures with several lines of captions such as:

    #+CAPTION: first line,
    #+CAPTION: second line
    [[file:media/myPicture.png]]

This is because, in this case, org-odt-plain-text is called at some
point with " " as value for `text`. In this context, both `leading` and
`trailing` temporary variables contain the same value as `text`, making
the `substring` call crash.

The attached patch fixes the issue by considering that there is no
leading/trailing content when the input only contains spaces.

Best

[1] 87v8i3y135.fsf@cassou.me/">https://list.orgmode.org/orgmode/87v8i3y135.fsf@cassou.me/

Emacs  : GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 
1.16.0, Xaw3d scroll bars)
Package: Org mode version 9.7-pre (release_9.6.4-346-g7d41bd @ 
/home/cassou/.emacs.d/lib/org/lisp/)
-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill

Attachment: 0001-org-odt-plain-text-Fix-when-text-contains-only-space.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]