Tests and fixes whitespace bugs in sanitizer
This commit is contained in:
parent
ab7acc6db6
commit
db898e362b
|
@ -45,6 +45,8 @@ class InputHtmlParser(HTMLParser):
|
||||||
|
|
||||||
def get_output(self):
|
def get_output(self):
|
||||||
''' convert the output from a list of tuples to a string '''
|
''' convert the output from a list of tuples to a string '''
|
||||||
|
if self.tag_stack:
|
||||||
|
self.allow_html = False
|
||||||
if not self.allow_html:
|
if not self.allow_html:
|
||||||
return ''.join(v for (k, v) in self.output if k == 'data')
|
return ''.join(v for (k, v) in self.output if k == 'data')
|
||||||
return ''.join(v for (k, v) in self.output)
|
return ''.join(v for (k, v) in self.output)
|
||||||
|
|
Loading…
Reference in New Issue