From dd9ec4772b55c9aeb3a04b2ef2629c41d796edc7 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 23 May 2020 14:35:41 +0200 Subject: [PATCH] Lines with hard line breaks should not have a justify property --- nw/core/tohtml.py | 9 ++++++--- nw/core/tokenizer.py | 11 ++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/nw/core/tohtml.py b/nw/core/tohtml.py index f10ee1e3..33c247a9 100644 --- a/nw/core/tohtml.py +++ b/nw/core/tohtml.py @@ -119,7 +119,7 @@ class ToHtml(Tokenizer): self.theResult = "" thisPar = [] - parStyle = "" + parStyle = None tmpResult = [] for tType, tText, tFormat, tStyle in self.theTokens: @@ -158,11 +158,13 @@ class ToHtml(Tokenizer): # Process TextType if tType == self.T_EMPTY: + if parStyle is None: + parStyle = "" if len(thisPar) > 0: tTemp = "".join(thisPar) tmpResult.append("
%s
\n" % (parStyle, tTemp.rstrip())) thisPar = [] - parStyle = "" + parStyle = None elif tType == self.T_HEAD1: tHead = tText.replace(r"\\", "