Handle text justify in Tokenizer instead

This commit is contained in:
Veronica Berglyd Olsen
2024-10-21 18:54:19 +02:00
parent 75178b7874
commit 3cc5e4cc7a
10 changed files with 195 additions and 219 deletions
+8 -2
View File
@@ -622,6 +622,9 @@ class Tokenizer(ABC):
if aLine.startswith("%~"):
continue
if self._doJustify and not sAlign & self.M_ALIGNED:
sAlign |= self.A_JUSTIFY
cStyle, cKey, cText, _, _ = processComment(aLine)
if cStyle == nwComment.SYNOPSIS:
tLine, tFmt = self._extractFormats(cText)
@@ -935,8 +938,11 @@ class Tokenizer(ABC):
cStyle |= self.A_IND_T
if nLines == 1:
# The paragraph contains a single line, so we just
# save that directly to the token list
# The paragraph contains a single line, so we just save
# that directly to the token list. If justify is
# enabled, and there is no alignment, we apply it.
if self._doJustify and not cStyle & self.M_ALIGNED:
cStyle |= self.A_JUSTIFY
self._tokens.append((
self.T_TEXT, pLines[0][1], pLines[0][2], pLines[0][3], cStyle
))