Fix #1442 (html2epub creates enormous .opf)

This commit is contained in:
Kovid Goyal 2008-12-23 15:33:12 -08:00
parent fb008667e5
commit 0b80001ef0

View File

@ -16,7 +16,7 @@ def get_metadata(stream):
# Title
title = None
pat = re.compile(r'<!--.*?TITLE=(?P<q>[\'"])(.+)(?P=q).*?-->', re.DOTALL)
pat = re.compile(r'<!--.*?TITLE=(?P<q>[\'"])(.+?)(?P=q).*?-->', re.DOTALL)
match = pat.search(src)
if match:
title = match.group(2)
@ -28,7 +28,7 @@ def get_metadata(stream):
# Author
author = None
pat = re.compile(r'<!--.*?AUTHOR=(?P<q>[\'"])(.+)(?P=q).*?-->', re.DOTALL)
pat = re.compile(r'<!--.*?AUTHOR=(?P<q>[\'"])(.+?)(?P=q).*?-->', re.DOTALL)
match = pat.search(src)
if match:
author = match.group(2).replace(',', ';')
@ -36,7 +36,7 @@ def get_metadata(stream):
mi = MetaInformation(title, [author] if author else None)
# Publisher
pat = re.compile(r'<!--.*?PUBLISHER=(?P<q>[\'"])(.+)(?P=q).*?-->', re.DOTALL)
pat = re.compile(r'<!--.*?PUBLISHER=(?P<q>[\'"])(.+?)(?P=q).*?-->', re.DOTALL)
match = pat.search(src)
if match:
mi.publisher = match.group(2)