Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions unstructured/partition/html/transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,9 @@ def parse_html_to_ontology(html_code: str) -> ontology.OntologyElement:
def remove_empty_divs_from_html_content(html_content: str) -> str:
soup = BeautifulSoup(html_content, "html.parser")
divs = soup.find_all("div")
for div in reversed(divs):
if not div.attrs:
div.unwrap()
divs_to_unwrap = [div for div in divs if not div.attrs]
for div in reversed(divs_to_unwrap):
div.unwrap()
return str(soup)


Expand Down