mirror of
https://github.com/searxng/searxng
synced 2024-01-01 18:24:07 +00:00
[fix] handle single closing element in HTMLTextExtractor
This commit is contained in:
parent
06186e72a9
commit
699fe60e50
@ -82,8 +82,12 @@ class HTMLTextExtractor(HTMLParser):
|
||||
self.tags.append(tag)
|
||||
|
||||
def handle_endtag(self, tag):
|
||||
if not self.tags:
|
||||
return
|
||||
|
||||
if tag != self.tags[-1]:
|
||||
raise Exception("invalid html")
|
||||
|
||||
self.tags.pop()
|
||||
|
||||
def is_valid_tag(self):
|
||||
|
Loading…
Reference in New Issue
Block a user