diff --git a/src/calibre/ebooks/metadata/__init__.py b/src/calibre/ebooks/metadata/__init__.py index 9be40f9b49..134a0c3c23 100644 --- a/src/calibre/ebooks/metadata/__init__.py +++ b/src/calibre/ebooks/metadata/__init__.py @@ -15,8 +15,8 @@ from calibre import relpath _author_pat = re.compile(',?\s+and\s+', re.IGNORECASE) def string_to_authors(raw): - raw = _author_pat.sub('&', raw) raw = raw.replace('&&', u'\uffff') + raw = _author_pat.sub('&', raw) authors = [a.strip().replace(u'\uffff', '&') for a in raw.split('&')] return authors diff --git a/src/calibre/ebooks/oeb/stylizer.py b/src/calibre/ebooks/oeb/stylizer.py index 5f923c4311..5fcc7e3fac 100644 --- a/src/calibre/ebooks/oeb/stylizer.py +++ b/src/calibre/ebooks/oeb/stylizer.py @@ -169,7 +169,7 @@ class Stylizer(object): if not matches and class_sel_pat.match(text): found = False 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) found = True if found: