emacs-orgmode
[Top][All Lists]
Advanced

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

[O] [PATCH] Re: manual linebreaks in odt


From: Christian Moe
Subject: [O] [PATCH] Re: manual linebreaks in odt
Date: Wed, 23 Oct 2013 19:05:07 +0200
User-agent: mu4e 0.9.9.5-dev6; emacs 24.3.1

Hi,

Nicolas, Andreas did put the "\\" at the end, but the line must have got
wrapped in your email client.

I confirm the behavior Andreas reported -- spaces are being needlessly
added after forced line breaks in ODT export. 

A couple of redundant newlines in ox-odt.el seem to be at fault, so I
attach one of the simplest patches ever...

Yours,
Christian

>From 187ba51d721ef4e06ca7ae647216ada8800a9c32 Mon Sep 17 00:00:00 2001
From: Christian Moe <address@hidden>
Date: Wed, 23 Oct 2013 18:49:03 +0200
Subject: [PATCH] ODT: Stop adding leading space after line break

* lisp/ox-odt.el (org-odt-line-break): remove newline after line-break
tag
(org-odt-plain-text): ditto.

The exporter was pretty-printing the ODT XML with newlines after
forced line breaks, but LibreOffice would interpret those as
spaces. This led to a leading space after every manual line break.
---
 lisp/ox-odt.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index 57a9b6e..775fe1d 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -2059,7 +2059,7 @@ CONTENTS is nil.  INFO is a plist holding contextual 
information."
 (defun org-odt-line-break (line-break contents info)
   "Transcode a LINE-BREAK object from Org to ODT.
 CONTENTS is nil.  INFO is a plist holding contextual information."
-  "<text:line-break/>\n")
+  "<text:line-break/>")
 
 
 ;;;; Link
@@ -2980,7 +2980,7 @@ contextual information."
     ;; Handle break preservation if required.
     (when (plist-get info :preserve-breaks)
       (setq output (replace-regexp-in-string
-                   "\\(\\\\\\\\\\)?[ \t]*\n" "<text:line-break/>\n" output t)))
+                   "\\(\\\\\\\\\\)?[ \t]*\n" "<text:line-break/>" output t)))
     ;; Return value.
     output))
 
-- 
1.8.3.2


Nicolas Goaziou writes:

> Hello,
>
> Andreas Leha <address@hidden> writes:
>
>> Here is a MWE:
>> * Test line breaks in odt exports
>>
>> Here is a manual\\ linebreak.
>
> This is not a line break. In Org "\\" string has to appear at the end of
> line.
>
>
> Regards,


reply via email to

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