This PR fixes an issue where a complex pattern would hang forever, and never return, leaving an app in a complete freeze.
The string is **~*~~~*~*~**~*~* h e a r d ***~*~*~**~*~~~*
The library would detect the initial ~~~ pattern as the start of a tag, and the one at the end as the end of it. But the closeTag method would never return as remainingTags would never reach 0.
This PR fixes an issue where a complex pattern would hang forever, and never return, leaving an app in a complete freeze. The string is
**~*~~~*~*~**~*~* h e a r d ***~*~*~**~*~~~*
The library would detect the initial
~~~
pattern as the start of a tag, and the one at the end as the end of it. But thecloseTag
method would never return asremainingTags
would never reach 0.