Sphinx generates broken ePub on Windows. Closes #1232

This commit is contained in:
Takayuki Shimizukawa
2013-08-10 18:25:28 +09:00
parent 04d22a53d5
commit dfd9f1cdc8
2 changed files with 3 additions and 0 deletions

View File

@@ -42,6 +42,7 @@ Bugs fixed
footnote and auto symbol footnote. footnote and auto symbol footnote.
* PR#146,#1172: Fix ZeroDivisionError in Parallel Builds. Thanks to tychoish. * PR#146,#1172: Fix ZeroDivisionError in Parallel Builds. Thanks to tychoish.
* #1206: Fix i18n: gettext did not translate admonition directive's title. * #1206: Fix i18n: gettext did not translate admonition directive's title.
* #1232: Sphinx generates broken ePub on Windows.
Release 1.2 (beta1 released Mar 31, 2013) Release 1.2 (beta1 released Mar 31, 2013)

View File

@@ -538,6 +538,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
if ext not in ('.js', '.xml'): if ext not in ('.js', '.xml'):
self.warn('unknown mimetype for %s, ignoring' % filename) self.warn('unknown mimetype for %s, ignoring' % filename)
continue continue
filename = filename.replace(os.sep, '/')
projectfiles.append(_file_template % { projectfiles.append(_file_template % {
'href': self.esc(filename), 'href': self.esc(filename),
'id': self.esc(self.make_id(filename)), 'id': self.esc(self.make_id(filename)),
@@ -569,6 +570,7 @@ class EpubBuilder(StandaloneHTMLBuilder):
html_tmpl = None html_tmpl = None
if self.config.epub_cover: if self.config.epub_cover:
image, html_tmpl = self.config.epub_cover image, html_tmpl = self.config.epub_cover
image = image.replace(os.sep, '/')
mpos = content_tmpl.rfind('</metadata>') mpos = content_tmpl.rfind('</metadata>')
cpos = content_tmpl.rfind('\n', 0 , mpos) + 1 cpos = content_tmpl.rfind('\n', 0 , mpos) + 1
content_tmpl = content_tmpl[:cpos] + \ content_tmpl = content_tmpl[:cpos] + \