This commit is contained in:
Kovid Goyal 2009-06-24 17:51:35 -07:00
parent 9603e3f385
commit 87e78c48e3
2 changed files with 2 additions and 2 deletions

View File

@ -15,8 +15,8 @@ from calibre import relpath
_author_pat = re.compile(',?\s+and\s+', re.IGNORECASE) _author_pat = re.compile(',?\s+and\s+', re.IGNORECASE)
def string_to_authors(raw): def string_to_authors(raw):
raw = _author_pat.sub('&', raw)
raw = raw.replace('&&', u'\uffff') raw = raw.replace('&&', u'\uffff')
raw = _author_pat.sub('&', raw)
authors = [a.strip().replace(u'\uffff', '&') for a in raw.split('&')] authors = [a.strip().replace(u'\uffff', '&') for a in raw.split('&')]
return authors return authors

View File

@ -169,7 +169,7 @@ class Stylizer(object):
if not matches and class_sel_pat.match(text): if not matches and class_sel_pat.match(text):
found = False found = False
for x in tree.xpath('//*[@class]'): for x in tree.xpath('//*[@class]'):
if '.'+x.get('class').lower() in text.lower(): if text.lower().endswith('.'+x.get('class').lower()):
matches.append(x) matches.append(x)
found = True found = True
if found: if found: