[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 3d04af3826 1/2: org-latex-paragraph: Ensure that pa
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 3d04af3826 1/2: org-latex-paragraph: Ensure that paragraphs are not split by empty lines |
Date: |
Tue, 14 Mar 2023 08:59:04 -0400 (EDT) |
branch: externals/org
commit 3d04af3826b3258a643ee42abf092fb2ad652695
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>
org-latex-paragraph: Ensure that paragraphs are not split by empty lines
* lisp/ox-latex.el (org-latex-paragraph): If export creates single
paragraph contents with empty lines, remove the empty lines to ensure
that we retain a single paragraph.
Reported-by: Max Nikulin <manikulin@gmail.com>
Link: https://orgmode.org/list/tufdb6$11h2$1@ciao.gmane.io
---
lisp/ox-latex.el | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index b84fe89db1..698eee3e75 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -2980,7 +2980,14 @@ information."
"Transcode a PARAGRAPH element from Org to LaTeX.
CONTENTS is the contents of the paragraph, as a string. INFO is
the plist used as a communication channel."
- contents)
+ ;; Ensure that we do not create multiple paragraphs, when a single
+ ;; paragraph is expected.
+ ;; Multiple newlines may appear in CONTENTS, for example, when
+ ;; certain objects are stripped from export, leaving single newlines
+ ;; before and after.
+ (replace-regexp-in-string
+ (rx "\n" (1+ (0+ space) "\n")) "\n"
+ contents))
;;;; Plain List