Drop empty tokens from the tokenizer data

This commit is contained in:
Veronica Berglyd Olsen
2024-05-21 22:45:01 +02:00
parent adf0550571
commit 7a13b14c15
5 changed files with 31 additions and 137 deletions
+6 -9
View File
@@ -454,8 +454,12 @@ class ToOdt(Tokenizer):
pIndent = False
# Process Text Types
if tType == self.T_EMPTY:
pass
if tType == self.T_TEXT:
if self._firstIndent and pIndent and oStyle.isUnaligned():
self._addTextPar(xText, S_FIND, oStyle, tText, tFmt=tFormat)
else:
self._addTextPar(xText, S_TEXT, oStyle, tText, tFmt=tFormat)
pIndent = True
elif tType == self.T_TITLE:
# Title must be text:p
@@ -484,13 +488,6 @@ class ToOdt(Tokenizer):
elif tType == self.T_SKIP:
self._addTextPar(xText, S_SEP, oStyle, "")
elif tType == self.T_TEXT:
if self._firstIndent and pIndent and oStyle.isUnaligned():
self._addTextPar(xText, S_FIND, oStyle, tText, tFmt=tFormat)
else:
self._addTextPar(xText, S_TEXT, oStyle, tText, tFmt=tFormat)
pIndent = True
elif tType == self.T_SYNOPSIS and self._doSynopsis:
tTemp, tFmt = self._formatSynopsis(tText, tFormat, True)
self._addTextPar(xText, S_META, oStyle, tTemp, tFmt=tFmt)