mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
fd8eef3e39
commit
6898e0e622
@ -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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user