Skip to content

Infinite recursion with certain html #420

@ml-oliver

Description

@ml-oliver

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions