From 142d659b70933ffc9fdb78e3179b285b75fa988c Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Sun, 23 May 2021 16:31:06 +0200 Subject: [PATCH] Fix an issue with markdown export --- nw/core/tomd.py | 2 +- nw/core/toodt.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/nw/core/tomd.py b/nw/core/tomd.py index 05645a67..d95a6810 100644 --- a/nw/core/tomd.py +++ b/nw/core/tomd.py @@ -94,7 +94,7 @@ class ToMarkdown(Tokenizer): # Process Text Type if tType == self.T_EMPTY: if len(thisPar) > 0: - tTemp = "\n".join(thisPar) + tTemp = " \n".join(thisPar) tmpResult.append("%s\n\n" % tTemp.rstrip(" ")) thisPar = [] diff --git a/nw/core/toodt.py b/nw/core/toodt.py index 7fdb91bf..f5770c9f 100644 --- a/nw/core/toodt.py +++ b/nw/core/toodt.py @@ -400,15 +400,14 @@ class ToOdt(Tokenizer): self._addTextPar("Text_Body", oStyle, "") elif tType == self.T_TEXT: - tTemp = tText if parStyle is None: parStyle = oStyle - tFmt = " "*len(tTemp) + tFmt = " "*len(tText) for xPos, xLen, xFmt in tFormat: tFmt = tFmt[:xPos] + odtTags[xFmt] + tFmt[xPos+xLen:] - tTxt = tTemp.rstrip() + tTxt = tText.rstrip() tFmt = tFmt[:len(tTxt)] thisPar.append(tTxt) thisFmt.append(tFmt)