Process field values in QTextDocuments

This commit is contained in:
Veronica Berglyd Olsen
2024-10-28 17:30:34 +01:00
parent 041183f914
commit f92521c93a
13 changed files with 50 additions and 22 deletions
+1 -1
View File
@@ -315,7 +315,7 @@ def testFmtToHtml_ConvertParagraphs(mockGUI):
"or two<sup>ERR</sup> footnotes.</p>\n"
)
html.appendFootnotes()
html.closeDocument()
assert html._pages[-2] == (
"<p>Text with one<sup><a href='#footnote_1'>1</a></sup> "
"or two<sup>ERR</sup> footnotes.</p>\n"
+3
View File
@@ -44,6 +44,9 @@ class BareTokenizer(Tokenizer):
def doConvert(self):
super().doConvert() # type: ignore (deliberate check)
def closeDocument(self):
super().doConvert() # type: ignore (deliberate check)
def saveDocument(self, path) -> None:
super().saveDocument(path) # type: ignore (deliberate check)
+1 -1
View File
@@ -205,7 +205,7 @@ def testFmtToMarkdown_ConvertParagraphs(mockGUI):
md.doConvert()
assert md._pages[-1] == "Text with one[1] or two[ERR] footnotes.\n\n"
md.appendFootnotes()
md.closeDocument()
assert md._pages[-2] == (
"Text with one[1] or two[ERR] footnotes.\n\n"
)
+1 -1
View File
@@ -594,7 +594,7 @@ def testFmtToQTextDocument_Footnotes(mockGUI):
)
doc.tokenizeText()
doc.doConvert()
doc.appendFootnotes()
doc.closeDocument()
assert doc.document.blockCount() == 4
# 0: Scene