fix : issue with browser

This commit is contained in:
martin legrand 2025-03-30 17:22:35 +02:00
parent 36b80dc758
commit 8ccb6f4d77

View File

@ -156,6 +156,7 @@ class Browser:
element.decompose()
text = soup.get_text()
lines = (line.strip() for line in text.splitlines())
chunks = (phrase.strip() for line in lines for phrase in line.split(" "))
text = "\n".join(chunk for chunk in chunks if chunk and self.is_sentence(chunk))