writer_epub: Pretty print epub meta files

This commit is contained in:
Jim Miller 2026-01-13 13:47:56 -06:00
parent c8d6ce8004
commit 1d53c506c9

View file

@ -382,7 +382,7 @@ div { margin: 0pt; padding: 0pt; }
containertop.appendChild(rootfiles)
rootfiles.appendChild(newTag(containerdom,"rootfile",{"full-path":"content.opf",
"media-type":"application/oebps-package+xml"}))
write_to_epub("META-INF/container.xml",containerdom.toxml(encoding='utf-8'))
write_to_epub("META-INF/container.xml",containerdom.toprettyxml(encoding='utf-8'))
containerdom.unlink()
del containerdom
@ -826,7 +826,7 @@ div { margin: 0pt; padding: 0pt; }
package.appendChild(guide)
# write content.opf to zip.
contentxml = contentdom.toxml(encoding='utf-8')
contentxml = contentdom.toprettyxml(encoding='utf-8')
# tweak for brain damaged Nook STR. Nook insists on name before content.
contentxml = contentxml.replace(ensure_binary('<meta content="%s" name="cover"/>'%coverimgid),
ensure_binary('<meta name="cover" content="%s"/>'%coverimgid))
@ -883,7 +883,7 @@ div { margin: 0pt; padding: 0pt; }
index=index+1
# write_to_epub used, but already passed using svg_files
write_to_epub("toc.ncx",tocncxdom.toxml(encoding='utf-8'))
write_to_epub("toc.ncx",tocncxdom.toprettyxml(encoding='utf-8'))
tocncxdom.unlink()
del tocncxdom
@ -944,7 +944,7 @@ div { margin: 0pt; padding: 0pt; }
li.appendChild(atag)
# write_to_epub used, but already passed using svg_files
write_to_epub("nav.xhtml",tocnavdom.toxml(encoding='utf-8'))
write_to_epub("nav.xhtml",tocnavdom.toprettyxml(encoding='utf-8'))
tocnavdom.unlink()
del tocnavdom