Skip footnote section if there are none

This commit is contained in:
Veronica Berglyd Olsen
2024-04-15 18:30:07 +02:00
parent 92888338f4
commit c65dee1df9
2 changed files with 27 additions and 25 deletions
+1
View File
@@ -303,6 +303,7 @@ class ToHtml(Tokenizer):
def appendFootnotes(self) -> None: def appendFootnotes(self) -> None:
"""Append the footnotes in the buffer.""" """Append the footnotes in the buffer."""
if self._footnotes:
tags = HTML4_TAGS if self._genMode == self.M_PREVIEW else HTML5_TAGS tags = HTML4_TAGS if self._genMode == self.M_PREVIEW else HTML5_TAGS
footnotes = self._localLookup("Footnotes") footnotes = self._localLookup("Footnotes")
+1
View File
@@ -199,6 +199,7 @@ class ToMarkdown(Tokenizer):
def appendFootnotes(self) -> None: def appendFootnotes(self) -> None:
"""Append the footnotes in the buffer.""" """Append the footnotes in the buffer."""
if self._footnotes:
tags = STD_MD if self._genMode == self.M_STD else EXT_MD tags = STD_MD if self._genMode == self.M_STD else EXT_MD
footnotes = self._localLookup("Footnotes") footnotes = self._localLookup("Footnotes")