Flip if statement in Tokenizer

This commit is contained in:
Veronica Berglyd Olsen
2024-10-23 01:26:48 +02:00
parent fe63770d21
commit 52e85835df
2 changed files with 9 additions and 13 deletions
+1 -3
View File
@@ -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 20182024, Veronica Berglyd Olsen
+8 -10
View File
@@ -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