mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #821309 (html import: title/aurthor from old format document.)
This commit is contained in:
parent
f4b192c5e2
commit
bc75bc89f6
@ -38,17 +38,17 @@ def get_metadata_(src, encoding=None):
|
||||
if match:
|
||||
title = match.group(2)
|
||||
else:
|
||||
pat = re.compile('<title>([^<>]+?)</title>', re.IGNORECASE)
|
||||
match = pat.search(src)
|
||||
if match:
|
||||
title = match.group(1)
|
||||
if not title:
|
||||
for x in ('Title','DC.title','DCTERMS.title'):
|
||||
for x in ('DC.title','DCTERMS.title','Title'):
|
||||
pat = get_meta_regexp_(x)
|
||||
match = pat.search(src)
|
||||
if match:
|
||||
title = match.group(1)
|
||||
break
|
||||
if not title:
|
||||
pat = re.compile('<title>([^<>]+?)</title>', re.IGNORECASE)
|
||||
match = pat.search(src)
|
||||
if match:
|
||||
title = match.group(1)
|
||||
|
||||
# Author
|
||||
author = None
|
||||
@ -57,7 +57,7 @@ def get_metadata_(src, encoding=None):
|
||||
if match:
|
||||
author = match.group(2).replace(',', ';')
|
||||
else:
|
||||
for x in ('Author','DC.creator.aut','DCTERMS.creator.aut'):
|
||||
for x in ('Author','DC.creator.aut','DCTERMS.creator.aut', 'DC.creator'):
|
||||
pat = get_meta_regexp_(x)
|
||||
match = pat.search(src)
|
||||
if match:
|
||||
|
Loading…
x
Reference in New Issue
Block a user