mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1442 (html2epub creates enormous .opf)
This commit is contained in:
parent
fb008667e5
commit
0b80001ef0
@ -16,7 +16,7 @@ def get_metadata(stream):
|
|||||||
|
|
||||||
# Title
|
# Title
|
||||||
title = None
|
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)
|
match = pat.search(src)
|
||||||
if match:
|
if match:
|
||||||
title = match.group(2)
|
title = match.group(2)
|
||||||
@ -28,7 +28,7 @@ def get_metadata(stream):
|
|||||||
|
|
||||||
# Author
|
# Author
|
||||||
author = None
|
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)
|
match = pat.search(src)
|
||||||
if match:
|
if match:
|
||||||
author = match.group(2).replace(',', ';')
|
author = match.group(2).replace(',', ';')
|
||||||
@ -36,7 +36,7 @@ def get_metadata(stream):
|
|||||||
mi = MetaInformation(title, [author] if author else None)
|
mi = MetaInformation(title, [author] if author else None)
|
||||||
|
|
||||||
# Publisher
|
# 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)
|
match = pat.search(src)
|
||||||
if match:
|
if match:
|
||||||
mi.publisher = match.group(2)
|
mi.publisher = match.group(2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user