mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Minor cleanups for Guradian
This commit is contained in:
parent
e3e24a4711
commit
6c82706281
@ -11,6 +11,12 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
|||||||
from datetime import date
|
from datetime import date
|
||||||
|
|
||||||
|
|
||||||
|
def classes(classes):
|
||||||
|
q = frozenset(classes.split(' '))
|
||||||
|
return dict(attrs={
|
||||||
|
'class': lambda x: x and frozenset(x.split()).intersection(q)})
|
||||||
|
|
||||||
|
|
||||||
class Guardian(BasicNewsRecipe):
|
class Guardian(BasicNewsRecipe):
|
||||||
|
|
||||||
title = u'The Guardian and The Observer'
|
title = u'The Guardian and The Observer'
|
||||||
@ -47,6 +53,7 @@ class Guardian(BasicNewsRecipe):
|
|||||||
dict(attrs={'data-link-name': 'block share'}),
|
dict(attrs={'data-link-name': 'block share'}),
|
||||||
dict(attrs={'class': lambda x: x and 'inline-expand-image' in x}),
|
dict(attrs={'class': lambda x: x and 'inline-expand-image' in x}),
|
||||||
dict(attrs={'class': lambda x: x and 'modern-visible' in x.split()}),
|
dict(attrs={'class': lambda x: x and 'modern-visible' in x.split()}),
|
||||||
|
classes('badge-slot reveal-caption__checkbox mobile-only element-rich-link'),
|
||||||
dict(name=['link', 'meta', 'style']),
|
dict(name=['link', 'meta', 'style']),
|
||||||
]
|
]
|
||||||
remove_tags_after = [
|
remove_tags_after = [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user