branch: externals-release/org
commit 6b539c7ca8556d5c1e8d2f6bde757d27cdadd380
Author: Ihor Radchenko <[email protected]>
Commit: Ihor Radchenko <[email protected]>

    Revert "ox-odt: Avoid trailing spaces at the end of paragraphs"
    
    This is too risky for bugfix.
    
    This reverts commit fbdf1bbe9c53bb1a117a54b1ca4e5a63a571649e.
---
 lisp/ox-odt.el | 24 +-----------------------
 1 file changed, 1 insertion(+), 23 deletions(-)

diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index 2e649324ad..ba8b4d9d3b 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -91,8 +91,7 @@
     (verbatim . org-odt-verbatim)
     (verse-block . org-odt-verse-block))
   :filters-alist '((:filter-parse-tree
-                   . (org-odt--strip-trailing-newlines
-                       org-odt--translate-latex-fragments
+                   . (org-odt--translate-latex-fragments
                       org-odt--translate-description-lists
                       org-odt--translate-list-tables
                       org-odt--translate-image-links)))
@@ -3720,27 +3719,6 @@ contextual information."
 
 ;;; Filters
 
-;;; Plain text
-
-;; Trailing newlines appear as spaces in ODT.
-;; We do not want that in, for example, in paragraphs where
-;; end of paragraph is already signaled by ODT tag.
-(defun org-odt--strip-trailing-newlines (data _backend info)
-  "Strip trailing newlines in DATA at the end of contents.
-INFO is the communication channel."
-  (org-element-map data org-element-all-elements
-    (lambda (el)
-      (when-let* ((last-child (car (last (org-element-contents el)))))
-        (when (and (org-element-type-p last-child 'plain-text)
-                   (string-suffix-p "\n" last-child))
-          (when (length> last-child 1)
-            (org-element-insert-before
-             (substring last-child 0 (1- (length last-child)))
-             last-child))
-          (org-element-extract last-child))))
-    info nil nil t)
-  data)
-
 ;;; Images
 
 (defun org-odt--translate-image-links (data _backend info)

Reply via email to