mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2025-01-07 13:15:06 +00:00
org-odt-plain-text: Fix when text contains leading spaces
* lisp/ox-odt.el (org-odt-plain-text): Do not count leading spaces twice. Reported-by: Damien Cassou <damien@cassou.me> Link: https://orgmode.org/list/87v8i3y135.fsf@cassou.me
This commit is contained in:
parent
56dd046da8
commit
60ce29dc41
@ -2923,17 +2923,23 @@ contextual information."
|
||||
;; not be desired in scripts that do not separate words with
|
||||
;; spaces (for example, Han script). `fill-region' is able to
|
||||
;; handle such situations.
|
||||
;; FIXME: The unnecessary spaced may still remain when a newline
|
||||
;; FIXME: The unnecessary spacing may still remain when a newline
|
||||
;; is at a boundary between Org objects (e.g. italics markup
|
||||
;; followed by newline).
|
||||
(setq output
|
||||
(with-temp-buffer
|
||||
(insert output)
|
||||
(save-match-data
|
||||
(let ((leading (and (string-match (rx bos (1+ blank)) output)
|
||||
(match-string 0 output)))
|
||||
(trailing (and (string-match (rx (1+ blank) eos) output)
|
||||
(match-string 0 output))))
|
||||
(insert
|
||||
(substring
|
||||
output
|
||||
(length leading)
|
||||
(pcase (length trailing)
|
||||
(0 nil)
|
||||
(n (- n)))))
|
||||
;; Unfill, retaining leading/trailing space.
|
||||
(let ((fill-column most-positive-fixnum))
|
||||
(fill-region (point-min) (point-max)))
|
||||
|
Loading…
Reference in New Issue
Block a user