Skip to content

Markdown.markdown stuck in infinite loop <!-- leading to memory leaks #1586

Closed

Description

@Neeraj-Palliyali

Hi, new here :)

the package isn't handling content with <!-- essentially i think the < is causing the issue and leading to major memory leak

input_string = '''#Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lore \n\nLorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lore.\n\nALorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an .\n\nLorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an .\n\n## HTML Conditional Statements: A Dual-Edged Sword\n\nUpon closer examination of the email's HTML code, it became evident that the threat actors leveraged HTML conditional comments, specifically <!--[if mso]> and <!--[if !mso]>'''

trying markdown.markdown(input_string)

The processing is stuck and goes into an infinite loop

My understanding of the repo or markdown, in general, might be wrong :)

Activity

  1. facelessuser commented on Jan 20, 2026

    @facelessuser
    Collaborator

    The infinite loop problem is fixed on master, but the example you've given still doesn't render correctly. Sigh, I'll have to dig in further and figure out how we can ensure consistent results.

  2. added
    confirmedConfirmed bug report or approved feature request.
    on Jan 20, 2026
  3. added a commit that references this issue on Jan 20, 2026
    de3a00d
  4. facelessuser commented on Jan 20, 2026

    @facelessuser
    Collaborator

    I have a fix in #1587.

  5. Neeraj-Palliyali commented on Jan 20, 2026

    @Neeraj-Palliyali
    Author

    @facelessuser thanks, is master 3.10?

  6. facelessuser commented on Jan 21, 2026

    @facelessuser
    Collaborator

    No, that's why I referenced the branch and not a release, but it appears that fix, while it doesn't hang, drops data, which is why I opened a new PR that should completely fix it.

  7. Neeraj-Palliyali commented on Jan 21, 2026

    @Neeraj-Palliyali
    Author

    @facelessuser Thanks 👍

  8. added a commit that references this issue on Jan 21, 2026
    f925349
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmedConfirmed bug report or approved feature request.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions