Alir3z4 / Alir3z4/html2text

Infinite recursion with certain html

Open
#420 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.2k
Forks
296
PR merge metrics
No merged PRs in 30d

Description

HTML in the attached file below causes infinite loop of some kind, uses all CPU and process hangs indefinitely.

[hubspot.txt](https://github.com/user-attachments/files/16380213/hubspot.txt)

- Version by `2024.2.26`
- Test script
```
def convert_to_text():
converter = html2text.HTML2Text()
# html from http://www.hubspot.com
with open("hubspot.txt", "r") as f:
text = f.read()
print("Running html2text...")
text = converter.handle(text)
# hangs here and uses all CPU.
print(text)

```
- Python version `3.11`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.