Put Nook STR Cover 'fix' back in.

This commit is contained in:
Jim Miller 2018-08-10 13:29:14 -05:00
parent f7bf2f7d0a
commit d50e6d084b

View file

@ -26,6 +26,7 @@ import re
# py2 vs py3 transition
from ..six import text_type as unicode
from ..six import string_types as basestring
from ..six import ensure_binary
from ..six import BytesIO # StringIO under py2
## XML isn't as forgiving as HTML, so rather than generate as strings,
@ -580,10 +581,10 @@ div { margin: 0pt; padding: 0pt; }
# write content.opf to zip.
contentxml = contentdom.toxml(encoding='utf-8')
# Causes py2 vs py3 issues with encoding nonsense. Skip for now.
# tweak for brain damaged Nook STR. Nook insists on name before content.
# contentxml = contentxml.replace('<meta content="%s" name="cover"/>'%coverimgid,
# '<meta name="cover" content="%s"/>'%coverimgid)
contentxml = contentxml.replace(ensure_binary('<meta content="%s" name="cover"/>'%coverimgid),
ensure_binary('<meta name="cover" content="%s"/>'%coverimgid))
outputepub.writestr("content.opf",contentxml)
contentdom.unlink()