91f29ea7b8
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.
42 lines
742 B
HTML
42 lines
742 B
HTML
<!--
|
|
This test case represents HTML…
|
|
-->
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>
|
|
This is a title
|
|
</title>
|
|
</head>
|
|
<body>
|
|
<div>
|
|
<p>
|
|
This is the first paragraph.
|
|
</p>
|
|
<p>
|
|
Now now, second paragraph?
|
|
</p>
|
|
<div>
|
|
<p>
|
|
I'm nested in a div.
|
|
</p>
|
|
<ul>
|
|
<li>List item one.
|
|
</li>
|
|
<li>List item two. There isn't a third. Hahaha.
|
|
</li>
|
|
</ul>
|
|
<p>
|
|
Because, you know, lists should have a minimum of three items.
|
|
</p>
|
|
</div>
|
|
<p>
|
|
Penultimate paragraphs are sometimes the best.
|
|
</p>
|
|
</div>
|
|
<p>
|
|
Don't Cray; Buy Amiga!
|
|
</p>
|
|
</body>
|
|
</html>
|