From 6898e0e622e10a89c5cd928b497af8c11c5a7118 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 5 Mar 2010 12:43:56 -0700 Subject: [PATCH] ... --- src/calibre/ebooks/oeb/stylizer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/ebooks/oeb/stylizer.py b/src/calibre/ebooks/oeb/stylizer.py index 3e7cca981e..75c64a7dfd 100644 --- a/src/calibre/ebooks/oeb/stylizer.py +++ b/src/calibre/ebooks/oeb/stylizer.py @@ -190,11 +190,11 @@ class Stylizer(object): selector = CSSSelector(ntext) matches = selector(tree) - if not matches and class_sel_pat.match(text): + if not matches and class_sel_pat.match(text) and text.lower() != text: found = False + ltext = text.lower() for x in tree.xpath('//*[@class]'): - if text.lower().endswith('.'+x.get('class').lower()) and \ - text.lower() != text: + if ltext.endswith('.'+x.get('class').lower()): matches.append(x) found = True if found: