[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('/'):
|
for el in selector.split('/'):
|
||||||
if el not in content:
|
if el not in content:
|
||||||
raise ParseError()
|
return None
|
||||||
|
|
||||||
content = content.get(el)
|
content = content.get(el)
|
||||||
|
|
||||||
|
|
@ -195,7 +195,10 @@ class Dict(Filter):
|
||||||
return selector
|
return selector
|
||||||
|
|
||||||
def filter(self, txt):
|
def filter(self, txt):
|
||||||
|
if txt is not None:
|
||||||
return txt
|
return txt
|
||||||
|
else:
|
||||||
|
return self.default_or_raise(ParseError())
|
||||||
|
|
||||||
|
|
||||||
class CleanHTML(Filter):
|
class CleanHTML(Filter):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue