From 52e85835dfb5f43ae0fe3f4ff2f55cda7aa25780 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Wed, 23 Oct 2024 01:26:48 +0200 Subject: [PATCH] Flip if statement in Tokenizer --- novelwriter/formats/shared.py | 4 +--- novelwriter/formats/tokenizer.py | 18 ++++++++---------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/novelwriter/formats/shared.py b/novelwriter/formats/shared.py index ef36e955..87189b85 100644 --- a/novelwriter/formats/shared.py +++ b/novelwriter/formats/shared.py @@ -3,9 +3,7 @@ novelWriter – Formats Shared ============================ File History: -Created: 2024-10-21 [2.6b1] TextFmt -Created: 2024-10-21 [2.6b1] BlockTyp -Created: 2024-10-21 [2.6b1] BlockFmt +Created: 2024-10-21 [2.6b1] This file is a part of novelWriter Copyright 2018–2024, Veronica Berglyd Olsen diff --git a/novelwriter/formats/tokenizer.py b/novelwriter/formats/tokenizer.py index a6f67783..b3dc54d0 100644 --- a/novelwriter/formats/tokenizer.py +++ b/novelwriter/formats/tokenizer.py @@ -636,16 +636,14 @@ class Tokenizer(ABC): # Only valid keyword lines are parsed, and any ignored keywords # are automatically skipped. - if not self._doKeywords: - continue - - tLine, tFmt = self._formatMeta(aLine) - if tLine: - blocks.append(( - BlockTyp.KEYWORD, nHead, tLine, tFmt, sAlign - )) - if self._keepRaw: - tmpMarkdown.append(f"{aLine}\n") + if self._doKeywords: + tLine, tFmt = self._formatMeta(aLine) + if tLine: + blocks.append(( + BlockTyp.KEYWORD, nHead, tLine, tFmt, sAlign + )) + if self._keepRaw: + tmpMarkdown.append(f"{aLine}\n") elif aLine.startswith(("# ", "#! ")): # Title or Partition Headings