Apply hide scene/section regardless of format being filled in

This commit is contained in:
Veronica Berglyd Olsen
2024-03-13 15:53:28 +01:00
parent beaa583bc8
commit 9da99e3183
+22 -15
View File
@@ -646,15 +646,18 @@ class Tokenizer(ABC):
tFormat = self._fmtScene if isPlain else self._fmtHScene tFormat = self._fmtScene if isPlain else self._fmtHScene
if self._isNovel: if self._isNovel:
self._hFormatter.incScene() self._hFormatter.incScene()
tText = self._hFormatter.apply(tFormat, tText, nHead) if sHide:
tStyle = self._sceneStyle tText = ""
if tText == "": tType = self.T_EMPTY
tType = self.T_EMPTY if self._noSep or sHide else self.T_SKIP else:
tStyle = self.A_NONE tText = self._hFormatter.apply(tFormat, tText, nHead)
elif tText == tFormat: tStyle = self._sceneStyle
tText = "" if self._noSep else tText if tText == "": # Empty Format
tType = self.T_EMPTY if self._noSep else self.T_SEP tType = self.T_EMPTY if self._noSep else self.T_SKIP
tStyle = self.A_NONE if self._noSep else self.A_CENTRE elif tText == tFormat: # Static Format
tText = "" if self._noSep else tText
tType = self.T_EMPTY if self._noSep else self.T_SEP
tStyle = self.A_NONE if self._noSep else self.A_CENTRE
self._noSep = False self._noSep = False
self._tokens.append(( self._tokens.append((
@@ -676,12 +679,16 @@ class Tokenizer(ABC):
tType = self.T_HEAD4 tType = self.T_HEAD4
tStyle = self.A_NONE tStyle = self.A_NONE
if self._isNovel: if self._isNovel:
tText = self._hFormatter.apply(self._fmtSection, tText, nHead) if self._hideSection:
if tText == "": tText = ""
tType = self.T_EMPTY if self._hideSection else self.T_SKIP tType = self.T_EMPTY
elif tText == self._fmtSection: else:
tType = self.T_SEP tText = self._hFormatter.apply(self._fmtSection, tText, nHead)
tStyle = self.A_CENTRE if tText == "": # Empty Format
tType = self.T_SKIP
elif tText == self._fmtSection: # Static Format
tType = self.T_SEP
tStyle = self.A_CENTRE
self._tokens.append(( self._tokens.append((
tType, nHead, tText, [], tStyle tType, nHead, tText, [], tStyle