This commit is contained in:
Kovid Goyal 2010-03-05 12:43:56 -07:00
parent fd8eef3e39
commit 6898e0e622

View File

@ -190,11 +190,11 @@ class Stylizer(object):
selector = CSSSelector(ntext) selector = CSSSelector(ntext)
matches = selector(tree) 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 found = False
ltext = text.lower()
for x in tree.xpath('//*[@class]'): for x in tree.xpath('//*[@class]'):
if text.lower().endswith('.'+x.get('class').lower()) and \ if ltext.endswith('.'+x.get('class').lower()):
text.lower() != text:
matches.append(x) matches.append(x)
found = True found = True
if found: if found: