[filters] manage default in Dict filter
This commit is contained in:
parent
38a550d2b4
commit
96271b6de4
1 changed files with 5 additions and 2 deletions
|
|
@ -184,7 +184,7 @@ class Dict(Filter):
|
|||
|
||||
for el in selector.split('/'):
|
||||
if el not in content:
|
||||
raise ParseError()
|
||||
return None
|
||||
|
||||
content = content.get(el)
|
||||
|
||||
|
|
@ -195,7 +195,10 @@ class Dict(Filter):
|
|||
return selector
|
||||
|
||||
def filter(self, txt):
|
||||
return txt
|
||||
if txt is not None:
|
||||
return txt
|
||||
else:
|
||||
return self.default_or_raise(ParseError())
|
||||
|
||||
|
||||
class CleanHTML(Filter):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue