Originally Posted by kovidgoyal
yes they do. combine them all into one if you dont care about order with this function
Code:
def prefixed_classes(classes):
q = frozenset(classes.split(' '))
def matcher(x):
if x:
for candidate in frozenset(x.split()):
for x in q:
if candidate.startswith(x):
return True
return False
return {'attrs': {'class': matcher}}
keep_onlly_tags = [prefixed_classes('prefix1 prefix2 prefix3')]
|