Skip to content

Conversation

@balthisar
Copy link
Member

Don't recurse.

Instead of recursive calls for each nested level of HTML, the next level is
pushed to a stack on the heap, and returned to the main loop. This prevents
stack overflow at _n_ depth (where _n_ is operating-system dependent). It's
probably still possible to use all of the heap memory, but Tidy's allocators
already fail gracefully in this circumstance.

Please report any regressions of your own HTML!

NOTE: the XML parser is not affected, and is probably still highly recursive.
@balthisar balthisar merged commit c8fbde5 into next Aug 15, 2021
@balthisar balthisar deleted the recurse_squash branch August 15, 2021 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants