oalders/html-restrict — pull request #8 by perlpong (2013-01-26 16:40:09+00:00)
Title: Ensure stripper stack is always reset

I have found a bug in the strip_enclosed_content implementation. When deleting tags from the stripper stack in _delete_tag_from_stack(), it is assumed that the HTML within those tags is valid. However, if the HTML is broken, then the stack will not be cleared between calls to process(). Not only will this result in the $hr object becoming useless, but for every call to $hr->process the stripper stack will grow continuously, like this:

["script"]
["script", "script"]
["script", "script", "script"]
["script", "script", "script", "script"]
["script", "script", "script", "script", "script"]
["script", "script", "script", "script", "script", "script"]

As a test case, try this:

```perl
use Data::Dump;
use HTML::Restrict;

my $hr = HTML::Restrict->new;

dd $hr->process('xxxxxxx'); # "xxxxxxx"
dd $hr->process('