Add ODT meta namespace, add font format to HTML, and merge page break settings

This commit is contained in:
Veronica K. B. Olsen
2021-01-27 13:36:09 +01:00
parent 8ccd6a8ed3
commit cbbe1b4f47
12 changed files with 62 additions and 54 deletions
+5 -15
View File
@@ -211,12 +211,12 @@ def testCoreToHtml_Convert(dummyGUI):
# Title
theHtml.theTokens = [
(theHtml.T_TITLE, 1, "A Title", None, theHtml.A_PBB_NO | theHtml.A_CENTRE),
(theHtml.T_TITLE, 1, "A Title", None, theHtml.A_PBB_AUT | theHtml.A_CENTRE),
(theHtml.T_EMPTY, 1, "", None, theHtml.A_NONE),
]
theHtml.doConvert()
assert theHtml.theResult == (
"<h1 class='title' style='text-align: center; page-break-before: never;'>"
"<h1 class='title' style='text-align: center; page-break-before: auto;'>"
"<a name='T000001'></a>A Title</h1>\n"
)
@@ -299,24 +299,14 @@ def testCoreToHtml_Convert(dummyGUI):
"style='page-break-before: always; page-break-after: always;'>A Title</h1>\n"
)
# Page Break Avoid
# Page Break Auto
theHtml.theTokens = [
(theHtml.T_HEAD1, 1, "A Title", None, theHtml.A_PBB_AV | theHtml.A_PBA_AV),
(theHtml.T_HEAD1, 1, "A Title", None, theHtml.A_PBB_AUT | theHtml.A_PBA_AUT),
]
theHtml.doConvert()
assert theHtml.theResult == (
"<h1 class='title' "
"style='page-break-before: avoid; page-break-after: avoid;'>A Title</h1>\n"
)
# Page Break ANever
theHtml.theTokens = [
(theHtml.T_HEAD1, 1, "A Title", None, theHtml.A_PBB_NO | theHtml.A_PBA_NO),
]
theHtml.doConvert()
assert theHtml.theResult == (
"<h1 class='title' "
"style='page-break-before: never; page-break-after: never;'>A Title</h1>\n"
"style='page-break-before: auto; page-break-after: auto;'>A Title</h1>\n"
)
# Preview Mode
+1 -1
View File
@@ -623,7 +623,7 @@ def testCoreToken_Headers(dummyGUI):
theToken.isPart = False
theToken.doHeaders()
assert theToken.theTokens == [
(Tokenizer.T_TITLE, 1, "Novel Title", None, Tokenizer.A_PBB_NO | Tokenizer.A_CENTRE),
(Tokenizer.T_TITLE, 1, "Novel Title", None, Tokenizer.A_PBB_AUT | Tokenizer.A_CENTRE),
(Tokenizer.T_EMPTY, 1, "", None, Tokenizer.A_PBA | Tokenizer.A_CENTRE),
]
+1
View File
@@ -31,6 +31,7 @@ XML_NS = [
' xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"',
' xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"',
' xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"',
' xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"',
' xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"',
]