Update tokenizer and converters

This commit is contained in:
Veronica Berglyd Olsen
2023-11-25 18:12:45 +01:00
parent 8ed85363e2
commit 6a6b05c338
9 changed files with 95 additions and 32 deletions
+6 -3
View File
@@ -287,7 +287,10 @@ class ToHtml(Tokenizer):
para.append(stripEscape(tTemp.rstrip()))
elif tType == self.T_SYNOPSIS and self._doSynopsis:
lines.append(self._formatSynopsis(tText))
lines.append(self._formatSynopsis(tText, True))
elif tType == self.T_BRIEF and self._doSynopsis:
lines.append(self._formatSynopsis(tText, False))
elif tType == self.T_COMMENT and self._doComments:
lines.append(self._formatComments(tText))
@@ -454,9 +457,9 @@ class ToHtml(Tokenizer):
# Internal Functions
##
def _formatSynopsis(self, text: str) -> str:
def _formatSynopsis(self, text: str, synopsis: bool) -> str:
"""Apply HTML formatting to synopsis."""
sSynop = self._localLookup("Synopsis")
sSynop = self._localLookup("Synopsis") if synopsis else self._localLookup("Brief")
if self._genMode == self.M_PREVIEW:
return f"<p class='comment'><span class='synopsis'>{sSynop}:</span> {text}</p>\n"
else: